Photoshop Applescript fails , why?

Sivakatirswami katir at hindu.org
Fri Oct 29 00:35:39 EDT 2010


  OK, looks like a bug in LiveCode's API to the Script Editor compiler:

I suspected LiveCode can't even compile the script.

duh, right...  add  "put the result"  watch...

[field "PhotoshopScript"]

tell application "Adobe Photoshop CS5"
     activate
end tell

tell application "System Events"
  "Adobe Photoshop CS5"
     do action "merge leaves" from "Merge Leaves"
    end tell
end tell

Button "merge Leaves"

on mouseUp
    put fld "PhotoshopScript"  into tScript
     do tScript as AppleScript
     put the result
end mouseUp

"compiler error"


I better put this in QA right away, since we are close to next release.

it should not be that complicated:

tell application "Adobe Photoshop CS5"
     activate
      do action "merge leaves" from "Merge Leaves"
end tell

should work but also returns  "compiler error"




The same script compiles without problem and runs in Script Editor.app

On 10/28/10 5:36 PM, Terry Judd wrote:
> What happens if you use system events to activate Photoshop first and then
> tell Photoshop to do its action?
>
> tell application "System events" to tell application "Adobe Photoshop CS5"
> to activate
> tell application "Adobe Photoshop CS5" to do action [action] from [set]
>
> Terry...

That does not help. I tried it both ways:

tell application "System Events"
     tell application "Adobe Photoshop CS5"
         activate

         tell application "Adobe Photoshop CS5"
             do action "merge leaves" from "Merge Leaves"
         end tell
     end tell
end tell

does not work

and also (I use this form for calling menu items from other apps)

tell application "Adobe Photoshop CS5"
     activate
         tell application "System Events"
             tell application "Adobe Photoshop CS5"
             do action "merge leaves" from "Merge Leaves"
         end tell
     end tell
end tell

what is odd is that this script works fine to drive thru 4D

tell application "4D"
     activate
end tell

tell application "System Events"
     tell process "4D"
         tell menu bar 1
             tell menu bar item "Selections"
                 tell menu "Selections"
                     click menu item "Search Clipboard for EMBS"
                 end tell
             end tell
         end tell
     end tell
end tell

no compile error

LiveCode cannot compile the script for Photoshop?









More information about the use-livecode mailing list