Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Need help with applescripting photoshop!

Need help with applescripting photoshop!
Thread Tools
macjakob
Fresh-Faced Recruit
Join Date: Feb 2005
Location: Copenhagen, Denmark
Status: Offline
Reply With Quote
Aug 9, 2007, 08:10 AM
 
Hey,

I need to make an applescript (or maybe even just a droplet if its possible) for Photoshop which does the following:

1. Drop an Illustrator .ai file onto the droplet/applescript, open it in Photoshop (300 dpi)

2. Save a JPEG to the Illustrator files location

3. Make the open Illustrator file in Photoshop 72 dpi

4. Save the 72 dpi GIF to the original .ai file location.

5. Close the photoshop document without saving


Is this possible?


I've tried something like this, with pieces I have been able to find in the applescripting photoshop documentation (I am practically a noob in this):
----------------------
tell application "Adobe Photoshop CS3"
set display dialogs to never
set the_file to (choose file with prompt "Please choose a file") as Unicode text
open as PDF with options ¬
{classDF open options, heightixels real, widthixels real, mode:RGB, resolution:300, use antialias:true, page:1, constrain proportions:false} ¬

set myOptions to ¬
{class:JPEG save options, embed color profile:true, format optionsrogressive, quality:12, scans:3} ¬

save current document in file myFile as JPEG with options ¬
myOptions appending no extension without copying


set myOptions to ¬
{class:resize image, width:real, height:real, resolution:72} ¬


set myOptions to ¬
{class:GIF save options, dither:diffusion, dither amount:46, preserve exact colors:true, matte:background color matte} ¬


save current document in file myFile as CompuServe GIF with options ¬
myOptions appending no extension without copying

end tell
--------------------------

Could someone help me with making this – your help would be greatly appreciated!


Thank you in advance,
Jakob
     
bluedog
Mac Elite
Join Date: Aug 2000
Location: Minneapolis, MN
Status: Offline
Reply With Quote
Aug 9, 2007, 10:24 AM
 
Your applescript looks close to what you might want, but the automated functions in photoshop will probably be easier to accomplish your task.

Try recording an action of you opening one of the files, resizing and saving it with the 300dpi settings. Then go to File->Automate->Batch... and get your selected action. Now you can select to choose a folder for your source files, then choose your destinations for the JPGs. If this were saved as a droplet, you could then do the same for the 72dpi and have a separate droplet for those and the location.

From my experience with the actions you only get the save location choice once. So choosing to do the process in two passes resolves that issue. You may be able to create an applescript that's droppable that will then call the two actions (easier than using the applescript for photoshop itself)

Depending on the volume of images you need to process you would have a time savings by downsizing the 300->72dpi at the same time if you are able to get your applescript working. I'll see if there's any action/adjustments I can see from your code.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:09 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,