Sorry for this stupid question but how I can open some selected files in the fider with a certain application?
Is there any default variable that gets the selected files?
Thank you much
Sorry for this stupid question but how I can open some selected files in the fider with a certain application?
Is there any default variable that gets the selected files?
Thank you much
javito,
Try something like this:
tell application "Finder"
set fileToOpen to choose file with prompt "Choose your file to open."
tell application "whatever"
open file fileToOpen
end tell
end tell
Hope this is what you’re looking for.
PreTech
Hello PreTech, thanks!
That is not exactly what I want to do, I am trying to open several files in quarkxpress and print all in pdf, so the workflow would be:
1 select the quark files that I want to print
2 run the script
2a the script recognizes the files that I have selected -this is my problem -
2b the script tell quark to print each file in a separate pdf file.
3 finish the script
I have spent a lot of time looking how I can make it but all the applescript tutorials that I found are related to more complex stuffs
Thanks you for your time!
javito,
Then try this
tell application "Finder"
choose folder with prompt "Choose folder with files to open."
set pathToFiles to result as alias
set fileAliases to every file of folder pathToFiles as alias list
repeat with aFile in fileAliases
tell application "QuarkXPress"
activate
open aFile
-- do some operations
end tell
end repeat
end tell
I haven’t messed with Quark too much in as far as getting it to do something like print your pdf’s but this will get you started.
PreTech
If you want to use the current selection from the Finder, try something like this:
tell application "Finder"
repeat with thisItem in (selection)
tell application "QuarkXPress"
activate
open thisItem
-- print something
-- close document
end tell
end repeat
tell application "QuarkXPress" to quit
end tell