Photoshop to resize Illustrator eps's script
Photoshop to resize Illustrator eps's script
- Subject: Photoshop to resize Illustrator eps's script
- From: Paul Kampu <email@hidden>
- Date: Tue, 10 Feb 2004 09:42:12 -0500
Applescipt quirks? Scripting anomalies? Inquiring minds need to know!
Here is the scenario...
We have a folder selected in the Finder. We want to open all the Illustrator
eps9s within the folder in Photoshop, resize them and save them as Photoshop
documents. Then we move them all to another folder that the script creates.
Problem is, for some reason, the script is telling Illustrator to open the
files?! (and I don't have any idea as to why!)
Question is: Why won9t the script below work? (*careful of the line breaks*)
tell application "Finder"
set the sourceFolder to (folder of the front window) as alias
set sourceFolderName to name of sourceFolder
set itemList to every file of sourceFolder whose creator type is "ART5"
as string
set sourceFolderString to sourceFolder as string
try --in case, some how, the folder already exists
set LRfolder to make new folder in sourceFolder with properties
{name:sourceFolderName & " LR"}
end try
repeat with i from 1 to number of items in the itemList
set thisItem to item i of the itemList
my openAndSaveAs(thisItem)
end repeat
move (every file of sourceFolder whose name ends with "-LR") to LRfolder
end tell
on openAndSaveAs(thisItem)
tell application "Adobe Photoshop 7.0"
set epsOpenOptions to {class:EPS open options, constrain
proportions:true, mode:CMYK, resolution:200, use antialias:true}
open thisItem as EPS with options epsOpenOptions showing dialogs
never
resize image of document 1 height 2
set currentFilePath to file path of document 1 as string
my extractParentFolderPathFrom(currentFilePath)
set newPSDname to currentFilePath
set myPSDoptions to {class:Photoshop save options, embed color
profile:true, save layers:false}
save current document in file (newPSDname & "-LR") as Photoshop
format with options myPSDoptions appending no extension
close document 1 saving no
end tell
end openAndSaveAs
on extractParentFolderPathFrom(thisFilepath)
set thisFilepath to thisFilepath as text
set x to the offset of ":" in (the reverse of every character of
thisFilepath) as string
set the parentFolderPath to (characters 1 thru -(x) of thisFilepath) as
text
return the parentFolderPath
end extractParentFolderPathFrom
--
Paul Kampu
"Only those who can see the invisible, can accomplish the impossible!"
Patrick Snow
Author of "Creating Your Own Destiny"
_______________________________________________
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.