get numeric part of filename,paste it in a FM8 field+execute FM script

Hi everybody,
i’d need help in building an applescript that seems to me very complicated, and i don’t know if anybody of you know how to solve it:

these are how my filenames in a folder called “MyFolder” are set up:

00001_plus_any_testual_part.jpg
00002_plus_any_testual_part.jpg
00003_plus_any_testual_part.jpg …ecc…, ecc.

these are the action that my script should do when i drag “MyFolder” on it:

1- open Photoshop CS2
verify that my Filemaker 8 database called “MyDatabase” is already open, if is not, open it.

than should start a loop that do this:

2- for every single file of “MyFolder” do:

2.1 - get the first word on the left before “_” or before “space” (that is my numeric part)
2.2 - paste it in the field called “X” of “MyDatabase” and execute my filemaker script that i already have, called “MyFmScript” (this filemaker script basically go to the related record)
2.3 - copy a specific field of filemaker database called let say “FieldTobeCopied”
2.4 - open the image from which we have just gotten the numeric part in Photoshop CS2 and play a phtshop action that i already have , called “MyAction1” (this basically build a 1cm white stripe at the bottom of the image, and build a text layer)
2.5 - paste my “FieldTobeCopied” in the white stripe just built, possibly aligned leftside and vertically centered compared with the with stripe.
2.6 - save and close the image.

That’s it ! … :wink: thx in advance for anybody who’ll help me.

Browser: Safari 417.9.2
Operating System: Mac OS X (10.4)

Having said this: “2.1 - get the first word on the left before “_” or before “space” (that is my numeric part)”, you give examples that look like this: “00001_plus_any_testual_part.jpg”, “00002_plus_any_testual_part.jpg”, “00003_plus_any_testual_part.jpg” in which there are no spaces.

What does your file list look like? In essence you’re asking generic questions and expecting specific answers.

thank’s 4 your quick answer and sorry for the mistake!..
actually my files have got spaces, like this:

00001 plus any text.jpg
00002 plus any text.jpg
00003 plus any text.jpg …ecc…ecc…

thx,davemave

davemave328,

It sounds like you’re specifying a program you’d like someone else to build for you. There are probably people here who you could hire. If you’d like help with a script (or part of a script) you are building, it’s probably best to post some code here that doesn’t appear to work and ask questions about that.

Right now, I don’t see that you’re asking for help as much as asking for someone to do it for you. You’ll get more helpful (free) responses if you post about something specific that you have tried and can’t get to work than if you essentially write us a project specification and ask for a final product. People here are very happy to assist, but not to build a whole program for free. At least, I’m not. :slight_smile:

Good luck!

Here’s a frament to get you started:

-- assuming you've got a list of the files with the number separated from the text by a space:
set fileNames to {"00001 plus any text.jpg", "00002 plus any text.jpg", "00003 plus any text.jpg"}
set fileNums to {}
repeat with aName in fileNames
	set end of fileNums to first word of aName
end repeat
fileNums --> {"00001", "00002", "00003"}

Since I don’t have either FileMaker or PhotoShop, I can’t help you with them. Both are scriptable, both have dictionaries you can view from the Script Editor (Window menu > Library, click the + and navigate to the app), and there are lots of references here you can find by searching.

Krioni is correct, however; you won’t find someone to write this in its entirety for you, but you can get tons of help.

Good luck.