Re: Load Photoshop Actions
Re: Load Photoshop Actions
- Subject: Re: Load Photoshop Actions
- From: Stan Cleveland <email@hidden>
- Date: Wed, 14 Apr 2010 19:52:36 -0700
- Thread-topic: Load Photoshop Actions
On 4/14/10 4:25 PM, I wrote:
> Neither AppleScript, nor Photoshop¹s internal javascript, directly supports
> what you need. However, you *can* indirectly test for the existence of a
> particular action in a particular set this way:
>
> tell application "Adobe Photoshop CS4"
> try
> do action "My Action" from "My Set"
> on error number 8800 -- action or set not found
> -- handle error as desired
> end try
> end tell
I did a bit more exploring and, strangely, found that there's javascript
support for duplicating or deleting an action set, an action, or an
individual action command. For example, here's the Applescript code for
deleting an action set:
set actionSetName to "Set 1"
tell application "Adobe Photoshop CS4"
set display dialogs to never
activate
try
do javascript ("
var setName = new ActionReference();
setName.putName(charIDToTypeID( \"ASet\"), \"" & actionSetName & "\" );
var deleteSet = new ActionDescriptor();
deleteSet.putReference( charIDToTypeID(\"null\"), setName );
executeAction(charIDToTypeID( \"Dlt \"), deleteSet, DialogModes.NO);" )
set setFound to true
on error number 8800
set setFound to false
end try
end tell
return setFound as boolean
[Note: for some reason, AS's "try/on error" commands fail to trap the error
8800 that's generated if the action set is absent, unless the "set display
dialogs to never" command has been invoked first.]
Why one can duplicate or delete an action set, but not load or check for the
presence of one seems just a bit absurd to me. <sigh>
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden