• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Changes to Photoshop CS5 and Applescript

Explorer ,
May 06, 2010 May 06, 2010

Copy link to clipboard

Copied

Looks like there are some major Applescript changes to CS5, which is unwelcome for anyone with existing scripts. From what I can see, the difference (that affect me anyway) are

a) PSCS5 seems to dislike referring to files with "as alias" and removing this from my scripts helps them to work, whereas other apps need it, as did previous

b) apparently script support for referring to the currently document has changed. "if visible layer of current document is true then..." no longer works, nor do document 0, document 1, etc. Anyone know how to refer to the current document?

c) support for history doesn't seem to be there anymore. I cannot seem to use AS commands like, "set myState to history states as list" or "set current history state to history state newState" were awesome for my workflow, but are they impossible to achieve now?

d) One more. The important "set docref to make new document with properties {height: 150, width: 150}" is also broken. How would one make a new document in Applescript?

TOPICS
Actions and scripting

Views

32.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
New Here ,
Jun 02, 2010 Jun 02, 2010

Copy link to clipboard

Copied

Hey Jesper,

Thanks for the fast response. Just wanted to let you know that the updated plugin fixed all of my errors.

Thanks again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 02, 2010 Jun 02, 2010

Copy link to clipboard

Copied

Excellent & thanks for letting me know.

Jesper

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 09, 2010 Jun 09, 2010

Copy link to clipboard

Copied

Please also send me the patch plug in.

chris.paveglio *at*  clippermagazine  *dot* com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 13, 2014 Nov 13, 2014

Copy link to clipboard

Copied

LATEST

This is the biggest problem Adobe has. They laid off a couple of the wrong people. They should have kept a couple of the OS gurus.

I've had to manually to into the registry to link photoshop, indesign, and illustrator files. Who knows what the links are with droplets. They should just work!

But uninstalling all the apps, running a goofy little utility that never should have been created in the first place, then reinstalling all the apps is NOT the signature of a class operation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 21, 2010 Jun 21, 2010

Copy link to clipboard

Copied

Hi Jesper,

Thanks for releasing the fixed plug-in.

Could you please send me a copy to support at zevrix dott com.

Do you know when the fixed plug-in will be incorporated with Photoshop?

One of Zevrix products, LinkOptimizer, relies on AppleScript interaction with Photoshop. Several users reported this problem and I'd like to have some more specific info for them, if possible. Although it looks like this problem is quite rare.

Thanks,

Leo Revzin

Zevrix Solutions

http://zevrix.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 28, 2010 Jun 28, 2010

Copy link to clipboard

Copied

Jesper, are you an Adobe employee? Is this an official patch?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 30, 2010 Jun 30, 2010

Copy link to clipboard

Copied

For people who got the updated Scripting Support plug-in from Jesper: In case you did not see the memo...

-------------------------------------------------------------------------------------------

Subject: IMPORTANT: Plug-ins to replace before running the Photoshop 12.0.1 live patch

Dear Photoshop customer,

You have been identified as someone who may have replaced plug-ins that were not in the 12.0 shipping version of Photoshop. In order to run the 12.0.1 patch that will be released later tonight at 9pm PST, you will need to replace the 12.0.1 beta versions with the 12.0 versions of the plugins. Here are the 3 plugins that are known to be affected:

  • Liquify
  • MultiProcessor Support
  • ScriptingSupport


Here are the full paths for each plugin:

Adobe Photoshop CS5/Plug-Ins/Extensions/MultiProcessor Support.plugin
Adobe Photoshop CS5/Plug-Ins/Extensions/ScriptingSupport.plugin
Adobe Photoshop CS5/Plug-Ins/Filters/Liquify.plugin

*Note: you only need to replace the beta version of the plugin you were given (not all three plugins)*


Once you have replaced these files, you will be able to successfully run the 12.0.1 patch installer via Help > Updates.

If you have forwarded beta versions of these plugins to anyone else, please also forward this email so they can successfully run the patch.

Barry Young
Quality Engineering Manager, Photoshop

------ End of Forwarded Message

I've attached the 12.0 ScriptingSupport plug-in, in case you do not have the original.

Thanks for your help!
Meredith

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 17, 2010 Jul 17, 2010

Copy link to clipboard

Copied

I have successfully upgraded the scripting support plugin to v12.0.1 when I upgraded Photoshop. I am still having problems with several scripts that worked fine in CS4. I cannot get Photoshop to open a document either using an alias or the POSIX path.

This is a sample path that I have assigned to the variable, theimage: "Hard Drive/Users/alex/Pictures/Thumbnails/PAN_20070112_6237_thumb.jpg"

and here is the code that I am using to open the document:

tell application "Adobe Photoshop CS5"

activate

open theimage showing dialogs never

set docRef to current document

set ruler units of settings to inch units

set theheight to the height of the current document

set thewidth to the width of the current document

set theres to the resolution of the current document

end tell

The line, "open theimage..." fails to open the document in Photoshop, and when the next line, "set docRef..." executes, I get the error: "Adobe Photoshop CS5 got an error: Can’t get current document." since the doc was not opened in the first place.

Is anyone successfully opening documents via AppleScript using PS CS5 v12.0.1, and if so, would you mind sharing the code with me?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 23, 2010 Jul 23, 2010

Copy link to clipboard

Copied

If you change your path to the Finder's path format like "Hard Drive:Users:alex:Pictures:Thumbnails:PAN_20070112_6237_thumb.jpg" and change the open command as "open alias theimage showing dialogs never", your script should work fine.

Another solution is taking out "Hard Drive" from your path, i.e. "/Users/alex/Pictures/Thumbnails/PAN_20070112_6237_thumb.jpg" and use the command "open alias theimage showing dialogs never". This is the correct POSIX path of your image file.

Let me know if you still have problem in opening the images.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 23, 2010 Jul 23, 2010

Copy link to clipboard

Copied

I've found a problem with the ScriptingSupport plugin as part of the 12.01 update:

Macs  in Snow leopard(10.6.3 or 4) running CS5 12.01 in 64 bit mode work reliably running scripts.

Macs in Leopard(10.5.8) running CS5 12.01 in 64 bit mode frequently fail to be able to run scripts reporting "unable to open image", as though the scriptngsupport.plugin had not been updated. I have confirmed that the plugin is version 12.01. This can be reproduced across a number of CS5 installs/Macs.

The solution has been to switch CS5 to 32 bit mode(file/ get info) and the errors stop.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 23, 2010 Jul 23, 2010

Copy link to clipboard

Copied

I'm running Mac OSX 10.6.4 and Photoshop 12.0.1 with the latest Scripting Support plugin. I have tried running AppleScripts with Photoshop in both 32 and 64 bit modes, and in both cases Photoshop was not able to execute a simple open command. The script that I am running is one that I have been successfully using for years with previous versions of Photoshop. Clearly there is still something that is broken with Photoshop CS5's support for AppleScript.

I am wondering if Adobe is going to address the issue at some point very soon, since PS CS5 has broken my production workflow???

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 23, 2010 Jul 23, 2010

Copy link to clipboard

Copied

Could you please post an example here? Thanks in advance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 23, 2010 Jul 23, 2010

Copy link to clipboard

Copied

Thanks Jon, I now see the error in my script (and I was convinced that it was Photoshop's fault).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 16, 2011 Sep 16, 2011

Copy link to clipboard

Copied

Hi I am having problems with this appleScript

  tell application "adobe photoshop CS5.1

  activate

  set myRes to 300 as number

  set myW to 900 as number

  set myH to 900 as number

  set myPath1 to alias "scriptPath:openPhotoShopDoc.js"

  do javaScript myPath1 with arguments {"Tif ", "side 1", myW, myH, myRes}

  end tell

It worked fine in CS4

Please send this patch to me also:

colin at versatile albums dot com

Hopefully it will solve my problem also.

Regards

AlbumMan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 16, 2011 Sep 16, 2011

Copy link to clipboard

Copied

Hi AlbumMan,

If you are using CS5.1 then you have the latest ScriptingSupport plug-in.

As for the script, since I don't know what's in you Javascript, openPhotoShopDoc.js, I can't comment on that. But on the AppleScript side, it seems OK. Could you give me an example of your JS? TIA.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 18, 2011 Sep 18, 2011

Copy link to clipboard

Copied

You may find this a bit confusing, but the details of the appleScript and the javaScript that follows are both created from variables entered within a Director Mx2004 movie.

The javaScript is then placed in a known location and that is passed to Photoshop

The appleScript is run by a Director Xtra command.

This is the javaScript.

// remember current unit settings and then set units to units used by script

var originalUnit = preferences.rulerUnits;

preferences.rulerUnits = Units.PIXELS;

// Close any open documents

while (app.documents.length > 0) {

app.activeDocument.close()

}

// Get size for new Document

var mattW = arguments[2];

var mattH = arguments[3];

// Create new page document

var docRef1 = app.documents.add(mattW,mattH,arguments[4],arguments[1],NewDocumentMode.RGB,DocumentFill.WHITE);

// restore original ruler settings

app.preferences.rulerUnits = originalUnit;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 20, 2011 Sep 20, 2011

Copy link to clipboard

Copied

Hi AlbumMan,

I did not see any problem of the JavaScript, either. I can run the AppleScript to kick off the Javascript without problem. The only problem I encountered is "NewDocumentMo de.RGB". There is an extra space in between "Mo" & "de". Please let me know if you still have problem, and the error message you got.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

JonLo

The space in the script is just an unintentional line break during copy and pasting.

Very strange. Tried to run the script with just 1 small image and it worked fine. But only once!

Tried again with a larger image and it failed.

Tried again with Photoshop already open and it failed on both attempts.

Here is the message recieved:

error screen.jpg

I am recieving complaints from my Italian clients.

So as you can see it is an Italian version. I am testing in this language for my clients.

Also I should mention that it is a 30 day trial version as I only have CS4 on my system.

It is version 12.1 extended

Regards

AlbumMan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

This error is from JavaScript, and the only command you show here is "app.documents.add()", which is an essential function and should not have any problem. I could not reproduce the error even with a loop of many iterations calling from AppleScript.

On the AppleScript front, it will be more safe to change your script as follows:

set myPath1 to "scriptPath:openPhotoShopDoc.js"

do javaScript alias myPath1 with arguments {"Tif ", "side 1", myW, myH, myRes}

But, if you could run the JavaScript, then it's not the issue. You might want to dig into your JavaScript to see which line caused the error to pop up.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 22, 2011 Sep 22, 2011

Copy link to clipboard

Copied

JonLo

That works fine. Just move the word "Alias" and it works great.

Must be a lot more sensative.

Many thanks

AlbumMan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 05, 2014 May 05, 2014

Copy link to clipboard

Copied

Please send me the fix too!

pe (minus) te (at) web (dot) de

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 19, 2010 May 19, 2010

Copy link to clipboard

Copied

- Mac OS X 10.6.3, CS5 French

- 64-bit (iMac Core 2 Duo)

- No third-party plugin

- No scripting addition

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 07, 2010 May 07, 2010

Copy link to clipboard

Copied

Has anyone else noticed that all but the standard command suites are missing? Drag-drop CS5 onto the AppleScript Editor icon and see if there's more than "Standard Suite", "Text Suite" and "Type Definitions".

My scripts in CS5 generally run with some modification, but the commands not in these dictionaries are called by event code, not standard AppleScript.

Also, I've noticed that they've changed the way they refer to the active document, but without the proper dictionaries, I can't develop a workaround.

I really hope Adobe doesn't sit on this until CS6 -- it's quite a dealbreaker.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 13, 2010 May 13, 2010

Copy link to clipboard

Copied

In some situations Applescript Editor does run into communication problem with Photoshop. The safest way to make sure you will see all the terminologies in the library is to follow the steps below:

1. Save your script

2. Quit Applescript Editor

3. Quit Photoshop

4. Relaunch Photoshop

5. Open your saved script and recompile.

To make sure your script will run every time, you could save your compiled script as an Applescript app, then there is much less chance of getting into "Compiling errors."

For "as alias" problem, it had been identified the Standard library and Photoshop have different interpretation of the alias. To work around the problem, you could first cast the alias as "string", then in Photoshop cast it back "as alias." This should work around the current problem. For example:

set theImage to (choose file with prompt "Please select an image file:") as string  --This is from StandardAdditions of AppleScript Dictionary
tell application "Adobe Photoshop CS5"
   open alias theImage --"open file theImage" should work (w/o quote), too.
end tell

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2010 May 13, 2010

Copy link to clipboard

Copied

Thank you for this reply; I'll be sure to try the steps do see if I can reestablish a connection to Photoshop if it goes wonky after a lot of scripting.

I should have been more specific regarding document handling.

With CS4 I had no problem in setting a variable as a reference to the "front document", which I would then use via a tell statement; this would ensure that scripted actions were directed at a particular document, in case I inadvertently switched windows, or if the script action requires that the intended document actually is the front document.

It worked flawlessly in CS4; I cannot figure out how to do this in CS5.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines