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

How to update scripts on a computer group network

Enthusiast ,
Oct 15, 2012 Oct 15, 2012

I want to add a Script action by calling addMenuItem on actions panel.

That gave me the script listener code:

var idAdobeScriptAutomationScripts = stringIDToTypeID( "AdobeScriptAutomation Scripts" );

    var desc3 = new ActionDescriptor();

    var idjsCt = charIDToTypeID( "jsCt" );

    desc3.putPath( idjsCt, new File( "C:\\Program Files (x86)\\Adobe\\Adobe Photoshop CS5\\Presets\\Scripts\\testScript.jsx" ) );

executeAction( idAdobeScriptAutomationScripts, desc3, DialogModes.NO );

My aim is to call this changing the path of the script to (where there aren't any administrator previleges):

"C:\\Users\\user\\AppData\\Roaming\\Adobe\\Adobe Photoshop CS5\\testScript.jsx"

But... It don't let me call it and give me an error.

This is verry important to solve because it will give me access to update all the scripts on all computers on the network at the same time, even if they have no administrator previlegies (PCs).

Another solution is to add one only once, on administrator previleges, a script that would call my user script (updated any time I want and without administrator privilegies).

It could be, for example:

$.evalFile("C:\\Users\\user\\AppData\\Roaming\\Adobe\\Adobe Photoshop CS5\\testScript.jsx");

and if I need arguments to call from it I could use

$.setenv and $.getenv

Is this the only chance I have

There is another way of updating script on a group of computers on a network?


TOPICS
Actions and scripting
1.2K
Translate
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
Community Expert ,
Oct 15, 2012 Oct 15, 2012

You may be able to add a network folder that is shared read write by those that can modify and add scripts and are read only to other network users into users Photoshop installations.  Scripts can be run from any folder but only scripts in Photoshop Scripts path are listed in the script list. Scripts outside of Photoshop's scripts path must be browsed to or recorded in an action.  The problem with adding a lot of scripts into Photoshop is the script list becomes very large. You can group script into section however sections have no visible titles and these groups can not be collapsed so navigating in scripts menu File>Scripts menu become harder then navigating the Actions Palette. 

To add a Folder to Photoshop's scripts path you need to add on a Window's system a shortcut to the folder into each version of Photoshop's Presets\Scripts folder. On a Mac add a UNIX file system link there or what ever is like a windows shortcut. A network shortcut||linl would look something like \\server\share name\file_path

The script list is created when Photoshop initilizes so if a script is added into Photoshop Scripts paths the user adding the script and orther using currently using Photoshop will not see it in the Script list untill till they restart Photoshop.  Current script in the script list can be updated and used. So be sure the update is good before replaceing an old script.

Message was edited by: JJMack

JJMack
Translate
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
Enthusiast ,
Oct 16, 2012 Oct 16, 2012

Thanks for the explanation.

Why scriptListener gives me the code when I go to the actions panel and record an action with addMenuItem going to File>Scripts>anyScript

and when I do the same but I go to

File>Scripts>Browse... (select script)

it doesn't write anything with script listener

Can you explain this?

As I undertood, I could add a link folder next to those scripts that directs to the folder on the network, right?

Translate
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 ,
Oct 16, 2012 Oct 16, 2012
LATEST

I just use cs6 and did a menu file>scripts>Browse to my desktop and selected a test script tttt.jsx the scriptlistener log recorded the code at the bottom here I do not know why it did not record something for you.

You add the link into all Photoshop install trees into the Photoshop Version folder \Presets\Scripts\

You  do not need the link if you going to browse to script in an action or use script listener code. Note the full path is recorded in the code. If you browse to a network share I would expect to see a path like \\servername\share name\file path\scripthname.jsx

// =======================================================

var idAdobeScriptAutomationScripts = stringIDToTypeID( "AdobeScriptAutomation Scripts" );

    var desc3 = new ActionDescriptor();

    var idjsCt = charIDToTypeID( "jsCt" );

    desc3.putPath( idjsCt, new File( "C:\\Documents and Settings\\Mr Mouse\\Desktop\\tttt.jsx" ) );

    var idjsMs = charIDToTypeID( "jsMs" );

    desc3.putString( idjsMs, """2""" );

executeAction( idAdobeScriptAutomationScripts, desc3, DialogModes.NO );

JJMack
Translate
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