I apologize in advance for not supplying code for evaluation, but I would like to know if the following is possible:
Rather than ask potential people who would install a script made available to them on a website to use Script Events Manager, is there a workaround? It would seem that IF statements could be used (e.g., if a file is opened, the topmost layer is found, a new layer is made and then merge visible is run, and then the File Info dialog box is opened so that the user can include their name). Potential users in my field (Science) would likely run into problems with Script Events Manager.
Can the IF statement include such things as when the application is opened? (e.g., when the application is opened, the Preferences>General dialog box opens).
Thank you in advance!
Noob with generic questions
-
Mike Hale
Noob with generic questions
If I understand what you are asking the answer is no. A normal script can not run unless Photoshop is running. And for the most part the user can't interact with Photoshop while the script is running like setting preferences.
To monitor things like app open, setting preferences you need event handlers. The good news is you can write a script to install the event handlers so the user will not have to understand how to use the Script Events Manager. The script can be either part of an installer or a separate script the user would only have to run once.
To monitor things like app open, setting preferences you need event handlers. The good news is you can write a script to install the event handlers so the user will not have to understand how to use the Script Events Manager. The script can be either part of an installer or a separate script the user would only have to run once.
-
jerry sedgewick
Noob with generic questions
OK, I get it. Then it would be nice to be able to record an action while the ScriptListener is running to get some idea of how the script would be written, but what happens while setting up in Script Events Manager doesn't get recorded. Any chance there is a script out there that installs event handlers so I can piggy-back on it?
-
Mike Hale
Noob with generic questions
Script Event Manager is a script that can be found in the scripts folder. I think Adobe created it so users could install event handlers without knowing anything about scripting. You could look at that script as an example.
You can also look under notifiers in the scripting guide. Here is an example of how to install an open event handler( notifier )
Code: Select all// add an event notifer for the open event to run a script to store the file path if smart object.
if(!app.notifiersEnabled) app.notifiersEnabled = true;
var hasOpenEvent = false;
for(var e = 0;e<app.notifiers.length;e++){
if(app.notifiers[e].event == 'Opn ') hasOpenEvent = true;
}
if(!hasOpenEvent) {
var eventFile = new File(app.path + "/Presets/Scripts/Event Scripts Only/openAsSmartObjectPathHandler.jsx");
app.notifiers.add( "Opn ", eventFile);
}
You can also look under notifiers in the scripting guide. Here is an example of how to install an open event handler( notifier )
Code: Select all// add an event notifer for the open event to run a script to store the file path if smart object.
if(!app.notifiersEnabled) app.notifiersEnabled = true;
var hasOpenEvent = false;
for(var e = 0;e<app.notifiers.length;e++){
if(app.notifiers[e].event == 'Opn ') hasOpenEvent = true;
}
if(!hasOpenEvent) {
var eventFile = new File(app.path + "/Presets/Scripts/Event Scripts Only/openAsSmartObjectPathHandler.jsx");
app.notifiers.add( "Opn ", eventFile);
}