Ach, I am stumped

I have tried for several hours to get this syntax right. Basically I have this script:

on run
set fileList to choose file with prompt “PDF files to combine:” with multiple selections allowed without invisibles
return combine(fileList)
end run

but instead of a file prompt, I want to specify the files to be combined and have it work automatically. I tried

set fileList to {"PCRdist Shirt Catalog (all).pdf"} and {"zorderform_current.pdf"}

but of course this is failing. How do I set the fileList to these two files, existing on the user desktop, so that the overall script will work?

Any help you can offer would be great.


something like this

set dt to path to desktop as text
set fileList to {alias (dt & "PCRdist Shirt Catalog (all).pdf"), alias (dt & "zorderform_current.pdf")}

Awesome, that worked great! Thank you very much!


This should work regarding lists in general. Stefan covered the alias part to make the filenames work quite
thoroughly :slight_smile:

set fileList to {“PCRdist Shirt Catalog (all).pdf”, “zorderform_current.pdf”}

You could also:

property filelist : {“PCRdist Shirt Catalog (all).pdf”, “zorderform_current.pdf”} – at the top of your script.

To add list elements dynamically:

property filelist : {}

repeat with aFileName in yourSelection

set end of fileList to aFileNanem -- best way I believe to do this.

end repeat

Best Regards


We are drowning in information but starved for knowledge.
– John Naisbitt, Megatrends

Browser: Safari 533.4
Operating System: Mac OS X (10.6)