Photoshop interval function in scripting
I am trying to script something in Photoshop that has to run every X seconds. In JavaScript it would look like this:
I am trying to script something in Photoshop that has to run every X seconds. In JavaScript it would look like this:
The original post from @SuperMerlin (thank you) can be found here:
Using this script, I was able to create a sort of "Rube Goldberg Machine" or "Heath Robinson Contraption" to auto-save files, with or without a notification. Others may be able to create a more elegant solution:
automate save as or export with sequential file names
Some other links that may be useful can be found below, some links are to old forum posts that are now broken, but you can copy the name of the topic thread from and paste it into the forum search to overcome the link being broken:
Need help making a script for saving as jpg with interval
Automatic Save Function? (NOT for autorecovery)
EDIT: Just in case the link to SuperMerlin's script is broken in future forum software changes:
/*
Reminder to save?
https://forums.adobe.com/message/11013186#11013186
https://community.adobe.com/t5/photoshop/reminder-to-save/m-p/10466042?page=1
*/
#target bridge;
if( BridgeTalk.appName == "bridge" ) {
var psRem= new MenuElement( "command", "PS Reminder", "at the end of Tools");
}
psRem.onSelect = function () {
var mins = 60000 * 3; // Three minutes
psReminder = function(){
var bt = new BridgeTalk();
bt.target = "photoshop";
bt.body = "if(documents.length) alert('Save Reminder!');";
bt.send(4)
}
id = app.scheduleTask( "psReminder()", mins, true );
var win = new Window("palette","Photoshop Reminder");
win.bu1 = win.add("button",undefined,"Stop Reminder");
win.bu1.onClick = function(){
win.close(0);
app.cancelTask (id);
}
win.show();
};
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.