(no subject)
(no subject)
- Subject: (no subject)
- From: Romain Van Aelst <email@hidden>
- Date: Thu, 21 Jul 2005 02:00:28 +0200
Hi,
Need some help here.
The script I'm making drives me nuts. It runs well when launched from
the script editor but it does absolutly nothing happens when run from
the script menu.
The script should export the front most document of Photoshop as
gif,jpeg or png. Due to a bug in the Photoshop disctionary I'm forced
to use the raw four-letter code «class fltp» instead of 'format'.
And because I don't want to type that each time I compile the script
I placed the save options as a string in a "do script".
here's the script
--------------------
set name_dialog to (display dialog "Type name of file without the
extension" default answer "Coco" buttons {"gif", "jpeg", "png"}
default button 2 with title "Choose Name")
set file_name to text returned of name_dialog
set file_ext to button returned of name_dialog
set file_path to (path to desktop as text) & file_name & "." & file_ext
if file_ext is "gif" then
set extension to "CompuServe GIF"
set file_save_options to "{«class fltp»:" & extension & ", lossy:
0,dither:diffusion,dither amount :0,transparency:false,matte:
{class:RGB color, red:128, green:240, blue:80},interlaced:false,web
snap:0}"
else if file_ext is "jpeg" then
set extension to "JPEG"
set file_save_options to "{«class fltp»:" & extension & ",
optimized size:true, interlaced:false, quality:5, with profile:false,
blur:0.0, matte:{class:RGB color, red:128, green:240, blue:80}}"
else if file_ext is "png" then
set extension to "PNG"
set file_save_options to "{«class fltp»:" & extension & ",
interlaced:false, transparency:false,matte:{class:RGB color, red:128,
green:240, blue:80}}"
end if
do_script(file_path, file_save_options)
on do_script(myFile, save_options)
do script ("tell application \"Adobe Photoshop CS2\"" & return &
"export document 1 in file \"" & myFile & "\" as save for web with
options" & space & save_options & return & "end tell") as text
end do_script
--------------------
---------------------------------------------------------
A penny for your thoughts, 20$ to act it out and 50$ to send me a
picture of it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden