Creating a list of alias from folder contents
Creating a list of alias from folder contents
- Subject: Creating a list of alias from folder contents
- From: "Scott P. Richert" <email@hidden>
- Date: Sat, 25 Jan 2003 16:12:08 -0600
In my stay-open Classic applescript that I call from my ASStudio app
(see "Forcing a script to open in Classic"), I iterate through a series
of PS files in a folder (the files are named 0000_00xx, where xx is the
number of the QXP page from which the PS file was made), sending each
one individually to Acrobat Distiller. Here's the subroutine:
on distillPStoPDF(startPage, finalPage, psFolderNamePath)
set currentPage to startPage
repeat while currentPage is less than or equal to finalPage
if length of (currentPage as string) is 1 then
set psFileName to ((psFolderNamePath as string) & "0000_000" &
currentPage & ".ps") as alias
else
if length of (currentPage as string) is 2 then
set psFileName to ((psFolderNamePath as string) & "0000_00" &
currentPage & ".ps") as alias
end if
end if
tell application "Acrobat Distiller 5.0"
activate
open psFileName with wait
end tell
set currentPage to (currentPage + 1)
end repeat
end distillPStoPDF
But Distiller can take a list of alias, and I'd like to move as much of
this code to the ASStudio app as possible. In other words, I'd like to
reduce the subroutine in the stay-open Classic applescript to:
on distillPStoPDF(psFileName)
tell application "Acrobat Distiller 5.0"
activate
open psFileName with wait
end tell
end distillPStoPDF
Where psFileName would be a list of alias, not just a single alias like
it was in the original subroutine, and psFileName would be generated
inside my ASStudio app.
The question, then, is: What is the most efficient way to generate
psFileName as a list of alias from a folder full of files? Do I have
to iterate through the folder contents, adding an alias to the end of
the list with each iteration? Or is there some way to create the
entire list of alias with one quick command? If so, it's escaping me.
Any code would be greatly appreciated.
Scott P. Richert
Executive Editor
Chronicles: A Magazine of American Culture
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.