Copy link to clipboard
Copied
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 t
...Copy link to clipboard
Copied
Scripts run in Photoshop "lock up" the UI then finish and release the UI.
I believe that you would need to use BridgeTalk and run the script in Adobe Bridge, which would then do something in Photoshop.
The code is too advanced for me, but I can post an example.
Perhaps an extension panel could do this.
Copy link to clipboard
Copied
If you could maybe post something where it does alert('hi') every 30s or so, that would be seriously helpful!
Copy link to clipboard
Copied
Done! A new unthreaded reply added...
Copy link to clipboard
Copied
May one ask what you are trying to achieve with this?
Copy link to clipboard
Copied
I'd like to write a script that will export a jpg every 30s or so. To later turn into a timelapse. I got all the exporting code, now I just need to loop it every 30s or whatever. That is where I am stuck at now.
Copy link to clipboard
Copied
This is exactly the sort of thing that the Bridge script that I referred to does! I'll dig up the link for you...
Copy link to clipboard
Copied
Yes, you won't get it to work directly (photoshop does not have setInterval)
But these are some options you could consider:
Copy link to clipboard
Copied
Loll, since I can't remember I shared such hint ever can you link a post where I helped you with that 😄
Copy link to clipboard
Copied
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();
};
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Please add likes and or correct answers to the various posts so that when others are searching for a resolution to their issue it will be obvious that a solution was found.