Hi All,
I’ve searched and can’t seem to find the answer to this saving situation.
I’m adapting an older script to give some new functionality. The previous script would just save the current document into a new folder. I got that to work ok.
But now i have the need to change the file name, (For example file1.psd to file1_thumb.psd) and save it to a new folder.
This is the bare bones of what I currently have
tell application "Adobe Photoshop CS3"
activate
set mydoc to the current document
-- Rest of the script here:
save mydoc in alias (POSIX file "/Users/xxx/project name/Art Folder/05 Web images") appending lowercase extension
end tell
Any pointers would be great
Thanks,
-Andrew
Model: PowerBook G4 1.67GHz
Browser: Safari 525.20.1
Operating System: Mac OS X (10.5)
set DoneFolder to path to desktop as string
set prefixName to "Test_"
tell application "Adobe Photoshop CS3"
activate
set mydoc to name of current document
tell current document to save in (DoneFolder & prefixName & mydoc) as JPEG with options {quality:8} with copying
end tell
Jerome,
Thanks for your reply. The code didn’t work exactly how I needed, but it sure did point me in the right direction. The problem was that i needed to add a suffix to the file name. I figured out how to do it with the following code. I’m sure the is a more concise and or elegant way to do it. Any thoughts?
Again, thanx for pointing me in the right direction.
-Andrew
tell application "Adobe Photoshop CS3"
activate
set var_OutputFolder to alias (POSIX file "/Users/amannone/Desktop/Magazine Issue Folder Template/Issue Name/Art Folder/05 Web images") as string
-- get the file name without the extension
set var_withextension to the name of current document
set AppleScript's text item delimiters to "."
set mydoc_name to text item 1 of var_withextension
--now we have the name sans extension, let's proceed
my SFS_Sizes()
tell current document to save in (var_OutputFolder & mydoc_name & "_article" & ".psd") as Photoshop format with copying
-- I tried using "appending lower case extension, however it didn't work. (syntax error?) so, i manually added the ".psd"
end tell
on SFS_Sizes()
tell application "Adobe Photoshop CS3"
do javascript "insert my javascript here"
end tell
end SFS_Sizes
Model: PowerBook G4 1.67GHz
Browser: Safari 525.20.1
Operating System: Mac OS X (10.5)