Re: Photoshop 7 and Save for Web
Re: Photoshop 7 and Save for Web
- Subject: Re: Photoshop 7 and Save for Web
- From: Jeff Miller <email@hidden>
- Date: Tue, 30 Jul 2002 21:44:08 -0600
Hi Ron and Landis,
This seems like a real dumb question. Is there a way to provide the
file name that the Save for Web javascript saves to?
Seems to me like an attribute Photoshop would have provided an action
that saves to a file. But, I can't figure it out.
Thanks for you help,
Jeff
On Thursday, July 11, 2002, at 10:21 AM, Ron Bishop wrote:
I'm so happy that Photoshop finally decided to offer AppleScript
support. Now if only a little helpful documentation and few more
syntax examples were available...
I have a need to automate the "Save for Web" function. If I take a
PICT and do a "Save As" a JPEG with compression 7 (on a scale of
1-12) I get a file that's about 92k in size. If I do a "Save for
Web" with a compression of 60% (about 7/12) my file is 24k and very
similar in quality. Obviously I would prefer the smaller JPEG (I'm
guessing it's saved w/o a resource fork?).
I can't find a "Save for Web" in the Photoshop dictionary. The Save
options for JPEG don't seem to mention WWWReady like Graphic
Converter. Is this possible with Photoshop?
Thanks,
Landis
Landis -
I gotta admit this may be a lazy way, but I simply use the Script
Listener plugin to record the
action in Javascript and use the "do javascript" command. Here is what
i quickly came up with
using "Save for Web" then setting the image to JPEG and 60%. Then I
opened the
ScriptingListenerJS.log file from my desktop and copy and pasted to a
new BBEDIT document.
Here a ran a Search and Replace to (""" to "\"") to care of the quotes.
Then I created a script in
Script Debugger and pasted in the guts.
(All this would probably make a pretty good script...:)
You can see about third of the way down ("desc3.putInteger( id12,
60 );") is where the 60% is
inserted so you could put a variable in there.
Near the bottom is where I Photoshop to save it to my desktop so you
could have a variable
there also.
Multiple images? Put it all into a loop...etc...etc..
tell application "Adobe Photoshop 7.0"
activate
do javascript "{var id3 = charIDToTypeID( \"Expr\" );
var desc2 = new ActionDescriptor();
var id4 = charIDToTypeID( \"Usng\" );
var desc3 = new ActionDescriptor();
var id5 = charIDToTypeID( \"Op \" );
var id6 = charIDToTypeID( \"SWOp\" );
var id7 = charIDToTypeID( \"OpSa\" );
desc3.putEnumerated( id5, id6, id7 );
var id8 = charIDToTypeID( \"Fmt \" );
var id9 = charIDToTypeID( \"IRFm\" );
var id10 = charIDToTypeID( \"JPEG\" );
desc3.putEnumerated( id8, id9, id10 );
var id11 = charIDToTypeID( \"Intr\" );
desc3.putBoolean( id11, false );
var id12 = charIDToTypeID( \"Qlty\" );
desc3.putInteger( id12, 60 );
var id13 = charIDToTypeID( \"QChS\" );
desc3.putInteger( id13, 0 );
var id14 = charIDToTypeID( \"QCUI\" );
desc3.putInteger( id14, 0 );
var id15 = charIDToTypeID( \"QChT\" );
desc3.putBoolean( id15, false );
var id16 = charIDToTypeID( \"QChV\" );
desc3.putBoolean( id16, false );
var id17 = charIDToTypeID( \"Optm\" );
desc3.putBoolean( id17, true );
var id18 = charIDToTypeID( \"Pass\" );
desc3.putInteger( id18, 1 );
var id19 = charIDToTypeID( \"blur\" );
desc3.putDouble( id19, 0.000000 );
var id20 = charIDToTypeID( \"EICC\" );
desc3.putBoolean( id20, false );
var id21 = charIDToTypeID( \"Mtt \" );
desc3.putBoolean( id21, true );
var id22 = charIDToTypeID( \"MttR\" );
desc3.putInteger( id22, 255 );
var id23 = charIDToTypeID( \"MttG\" );
desc3.putInteger( id23, 255 );
var id24 = charIDToTypeID( \"MttB\" );
desc3.putInteger( id24, 255 );
var id25 = charIDToTypeID( \"SHTM\" );
desc3.putBoolean( id25, false );
var id26 = charIDToTypeID( \"SImg\" );
desc3.putBoolean( id26, true );
var id27 = charIDToTypeID( \"SSSO\" );
desc3.putBoolean( id27, false );
var id28 = charIDToTypeID( \"SSLt\" );
var list1 = new ActionList();
desc3.putList( id28, list1 );
var id29 = charIDToTypeID( \"DIDr\" );
desc3.putBoolean( id29, true );
var id30 = charIDToTypeID( \"In \" );
desc3.putPath( id30, new File( \"Macintosh
HardDrive:Users:krbishop:Desktop:\" ) );
var id31 = stringIDToTypeID( \"SaveForWeb\" );
desc2.putObject( id4, id31, desc3 );
executeAction( id3, desc2, DialogModes.NO );}"
end tell
Good luck,
Ron Bishop
www.daddydoodaa.com
_______________________________________________
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.
_______________________________________________
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.