Skip to main content
Inspiring
May 5, 2015
Open for Voting

Photoshop: Add/Share Actions + Scripts to CreativeCloud Library

  • May 5, 2015
  • 23 replies
  • 2015 views
Would be a comfortable way of getting script updates to coworkers.

23 replies

Participant
May 26, 2016
Thanks so much for the information you have provided here. Looks like I got a lot of homework to do to figure out how to type up those scripts and make sense of them.  Coding like that isn't something I excel at currently but it looks like it's time to learn 🙂 
Pedro Cortez Marques
Legend
May 24, 2016
Our actions are stores together in a ATN file in our central folder as I previous described.
The script triggered by the photoshop restart, removes this team Set of actions and reloads it again to make sure everybody uses the last updates. The cade is very simple and we do not use CC Library to store team actions (only few small short term projects).
This avoids the need the editor has to load the last actions set. He just need to restart. 
It is possible to load several sets on restart.

If the sets have also shortcuts that conflict with existing ones on photoshop, the existing one prevail, but the action is loaded the same.
 
Pedro Cortez Marques
Legend
May 24, 2016
There are events and ... inner-events or sub-events
Not all events can be retrieved. 

Lets take one of your examples: 1399355168:Shw :show
TypeID (number): 1399355168
charID( "Shw " ) // always 4 digits/spaces (the space in the end is important)
StringID( "show" )

You can access this same event on photoshop by using one of the 3. They are all the same.
And you can convert all to a number that photoshop understands using:
stringIDToTypeID( "show" )
charIDToTypeID( "Shw " )

More generic events some times need specific triggers. For example, I want to trigger the event when a user creates a colorSampler.
I must use this:
(...)
app.notifiers.add("Mk  ", cstoolEvent, "ClSm");
(...)
The "make" event has nested the colorsampler event "ClSm"

Adobe has some Event ID Codes (still incomplete) in the PDF of photoshop scripting - pag 216:
http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop_scriptref_js.pdf

And here - pag 84:
http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop_scripting_guide.pdf
Known Participant
May 24, 2016
Thank you for the code and links! I've been developing tools and scripts for my team in Photoshop, but haven't looked at Bridge scripting before.

I hadn't used the Scripts Events Manager before, but now that you pointed it out, I wanted to share something in there!

Go to File>Scripts>Scripts Events Manager... the dialog will appear...
Set the "Event" dropdown to "everything"
Set "Script" dropdown to "Clean Listener"
Click the "Add" button

Now all the actions you take in photoshop will record their listener properties to a file on your desktop called "Clean Listener.jsx" it looks like this:

#target photoshop
// No handler found for event: 2521::AdobeScriptAutomation Scripts
// No handler found for event: 1936483188:slct:select
// No handler found for event: 1836021349:move:move
// No handler found for event: 1836021349:move:move
// No handler found for event: 1214521376:Hd :hide
// No handler found for event: 1399355168:Shw :show
// No handler found for event: 1936483188:slct:select
// No handler found for event: 1131435084:CpTL:copyToLayer

Which will be invaluable when writing scripts in the future! I can use that to find the event ID to hook onto.
Pedro Cortez Marques
Legend
May 24, 2016
Hi Max

I don't need any CEP/photoshop api or extension on my team.
I am a plain "off-line" developer using script optimizations for teams:
- studios (lightroom), quality-control (bridge), and photo-editors (photoshop&Bridge)

It doesn't mean I will never develop a inner html extension for my team, but I need time and a long way to go.

To activate a startup listener from photoshop, I just run this code once on photoshop and the nex time it opens, it will run it alone again.

if (BridgeTalk.appName == "photoshop") {
    var myScriptInstall = File("[central folder some where in my team network]");
    app.notifiers.removeAll();   // remove all notifiers and add them again
    app.notifiersEnabled = true; // activate notifiers
    var eventFile = File(myScriptInstall +"/startUpPhotoshopScript.jsx");
    try{ // se tem rede, usa o script de instalação da origem, se não usa o da pasta Farfetch:
        if (eventFile.exists) {
            app.notifiers.add("Ntfy", eventFile); // each kind of notifier has a code. "Ntfy" is on photoshop restart
        } else {
            alert("Network fail");
        }
    }catch(e){}
}

After running this, verify it by opening File>Scripts>Scripts Events Manager... and it must be there.
Then resart photoshop and the script you defined will run on start event.

I suggest you use the Photoshop script forum to have more accurate answers regarding scripts:
https://forums.adobe.com/community/photoshop/photoshop_scripting
or Bridge Scripting:
https://forums.adobe.com/community/bridge/bridge_scripting
or even CS SDK for APIs, etc
https://forums.adobe.com/community/creativesuites/cs_sdk
https://forums.adobe.com/community/coding-corner

Many answers are already there and can be found.
Known Participant
May 24, 2016
Thanks for the in depth post Pedro! I hadn't considered adding a startup script. Could you please explain how you got it to run at startup? Is it a CEP extension or something like that?

I am pretty sure you can get the location of the Creative Cloud Files directory from the CEP/Photoshop api, so that could be another good place to transfer file updates to local storage...
Participant
May 24, 2016
That is interesting. I don't know much about scripts and how to make and run them, or what the listener (startup) is but that may be something I will have to check out.  We currently have a team around 15 but we grow to 20 -25 at time, so this would be very helpful.  I'm trying to streamline things as much as possible and people make Actions all the time to help out with our processes so to a central location where we can have people update their Actions automatically would be so helpful.  
Pedro Cortez Marques
Legend
May 24, 2016
I had to invent something to accomplish several levels of photoshop/bridge user update.
I have a central folder containing all my scripts, assets, atn, toolpresets, cameraraw tool presets, etc, etc.
Then, the each photoshop of my team has installed a listener (startup) that runs a central script.
The first thing this script does is to verify if there are any recent file (modified date) that has been updated by me, and it make sure that all file form the central folder have a recent copy on a public folder (in windows, we use c:\Users\Public\myFolder\)
When everything has been updated, the central script can then load every thing it needs from scripts.
Some variables can also been addressed to the app it self (photoshop or bridge) using prototypes to extend objects or $.setenv() $.getenv() or loading any script updated.

This is crucial for me, otherwise, it would be very hard to update PC by PC any update. 
If the team has 20, 30 or 50 users.
It is working well for some years and has the great advantage to run with non-admin rights user.
I also export a log install file where I can put any errors of installation, the user name, the PC number, the app versions, etc, etc.

Hope it helps.
Participant
May 9, 2016
Might have to look into this as well. Thanks so much for the info.  It's been a pain making sure everyone has the same actions.  We make so many new one constantly
Inspiring
May 9, 2016
Yeah, its pretty straightforward. You can't record actions that reference the Libraries panel (e.g. to drag an image into a document), which is a shame. Hope you find it useful