Photoscripter and Open Command
Photoscripter and Open Command
- Subject: Photoscripter and Open Command
- From: email@hidden
- Date: Fri, 20 Jul 2001 11:29:50 -0500
Hello,
Two questions:
1) I am writing an a script using Photoscripter. I would like to be able to
open an EPS file (Illustrator) and set the options - resolution, mode,
anti-aliased, constrained proportions. Is this possible? The dictionary
shows a simple open with no additional parameters.
2) When using the "Open" command, how can you tell if the Finder is
executing it or the application you have activated executes it? I believe
the Finder can use an alias or container hierarchy, but I think the
application wants the alias. It seems the instruction "open this_file" works
from the Finder, while "open the file this_file" works from Photoshop. So in
order for the latter instruction to work in the script below, the file name
must be changed to the alias format. Am I understanding this correctly?
tell application "Finder"
activate
set the chosen_folder to (choose folder with prompt "Pick the folder
containing the files to process:")
set the file_list to (every file of the chosen_folder) as list
repeat with this_file in the file_list
my makeWEBimages(this_file)
end repeat
tell application "Adobe. Photoshop. 5.0.2"
activate
quit
end tell
end tell
on makeWEBimages(this_file)
tell application "Adobe. Photoshop. 5.0.2"
activate
open this_file
tell the current document
if its width as real is greater than its height as real then
do script "horizontal image"
else
do script "vertical image"
end if
end tell
end tell
end makeWEBimages
Thanks,
Celli