Moderator: PS-Moderators
#target bridge
app.bringToFront();
// Use string as input
var a = 'alert("Hello")';
// Use file as input
var b = new File('~/Desktop/PS_Script.jsx');
// Use evalFile function
var c = $.evalFile(b);
// Check some process is NOT already running
if (!app.isProcessingJob()) {
//app.bringToFront();
// Execute every 10 seconds repeatedly
var d = app.scheduleTask(a, 10000, true);
}
//app.cancelTask(d);larsen67 wrote:Well I have the CS5 demo installed and Bridge is still a useable app beyond the 30 trial. Which means I can continue to play with this but NOT the other apps… So I took a look at this as I could find NO examples. I seems very straight forward although I could not test passing it a script that used another CS5 app… It ran for me until I quit the app.
- Code: Select all
#target bridge
app.bringToFront();
// Use string as input
var a = 'alert("Hello")';
// Use file as input
var b = new File('~/Desktop/PS_Script.jsx');
// Use evalFile function
var c = $.evalFile(b);
// Check some process is NOT already running
if (!app.isProcessingJob()) {
//app.bringToFront();
// Execute every 10 seconds repeatedly
var d = app.scheduleTask(a, 10000, true);
}
//app.cancelTask(d);
larsen67 wrote:Well this was bugging me so in typical fashion I did the opposite of what the scripting guide says &… Low and behold it works just fine. Rubbish that evalFile() and just plain old read() the dammed script file… You should be good to go…
#target bridge
app.bringToFront();
var thisFile = new File('~/Desktop/ZIP_Test.jsx');
var thisScript = readScript(thisFile);
var thisTask = addTask(thisScript, 30000, true);
$.writeln(thisTask);
function readScript(f) {
f.open('r');
var thisScript = f.read();
f.close();
return thisScript;
}
function addTask(s, d, rpt) {
// Check some process is NOT already running?
if (!app.isProcessingJob()) {
app.bringToFront();
// Execute script? every delay? repeatedly?
var tID = app.scheduleTask(s, d, rpt);
return tID;
}
}Return to Automation & Image Workflow
Users browsing this forum: No registered users and 1 guest