Place file in InDesign

Ok, here’s the deal…

I have 100 folders, named from “00” to “99”. Inside these folders I have lots of lots of EPS-files.
The files are named like this, example: “00374563”. Every file starts with “00” and the last two numbers indicates witch of my 100 folders the file are placed in. This example-file is located in folder “63”.

I’ve created a script to place these files in Indesign, and some of it look like this:

display dialog "File name here" default answer "" buttons {"OK", "Cancel"} default button 1
	set theAd to the text returned of the result as text
	display dialog "Two last numbers in file name here ..." default answer "" buttons {"OK", "Cancel"} default button 1
	set theFolder to the text returned of the result as text
	set theFinishedAd to "ADVOLUME:ADBPROD:AD:" & theFolder & ":00" & theAd as text

As you can see, I first type in my file name (374563), and then i have to tell my script witch folder to look in (63).

My question is this; Is i possible to do this in one operation, so that my co-workes dont have to press more buttons on the keyboard than absolutley nessacerry…

Thanks in advance, everyone!

Hi tto

you could get the last 2 numbers in the name by using something like this.

display dialog "File name here" default answer "" buttons {"OK", "Cancel"} default button 1
set theAd to characters -1 thru -2 of the text returned of the result as text

pass this into a variable then you wouldn’t have to ask for user interaction.

then get every folder or file that ends in these 2 characters or whatever your trying to do?
Hope this helps.