popClingwrap
popClingwrap

Reputation: 4217

Running extendscript (.jsx) launches ExtendscriptToolkit

I have written a couple of simple .JSX scripts that automate some common monkeywork I do in Photoshop.

I wrote the scripts in ExtendScriptToolkit and then execute them with File > Scripts > Browse and select the script I want. This runs the script and does what I want it to but it also launches ExtendScriptToolkit again each time. I have passed the script to a few others at work and they have all asked me to fix this so that the script executes purely within Photoshop but I can't make it work.

Basically, how can I run the script from Photoshop without it launching the script editor as well?

Cheers in advance for your help

Upvotes: 0

Views: 325

Answers (2)

mike
mike

Reputation: 1

$.level = 0;

"The current debugging level, which enables or disables the JavaScript debugger. Read only." Page 217

But when script run from ESTK $.level == 1

When from APP $.level == 0

Аnd solution may be if ($.level) $.writeln("JSC");

Upvotes: 0

fabianmoronzirfas
fabianmoronzirfas

Reputation: 4121

Check your script for $.writeln() statements. This could be a problem. You can also suppress debugging by setting the debug level.

Taken from the Object Model Viewer in ESTK

// $.level   
// Data Type: number 
// Core JavaScript Classes 
// The current debugging level, which enables or disables the JavaScript debugger.
// One of 0 (no debugging), 1 (break on runtime errors), or 2 (full debug mode).

$.level = 0; 
$.writeln("something");
alert("Hello World");

Edit:
I tried the debug level with the script above. It still opens the ESTK :-( Looks like it does not work. Can anybody confirm this?

Upvotes: 1

Related Questions