Timelapse and displaying images automatically

Discussion of Automation, Image Workflow and Raw Image Workflow

Moderators: Tom, Kukurykus

csuebele

Timelapse and displaying images automatically

Post by csuebele »

I've got a Nikon D200 mounted on a wall doing a time-lapse job. My customer wants this tethered to a computer and the images displayed on a monitor in another location. I'm getting Nikon Control Pro 2 to control the camera and save the images to a network folder. I would like to have PS detect when a new file is saved to that folder, run a script to format it and insert some headers and the time/date stamp into the image, and then display the image on the remote monitor. Is there some PS function or other software that will detect when a file is saved to a folder? I was thinking about writing a looping script that sleeps for a certain amount of time, then checks to see if the number of files has changed in a target folder. If so, the script would select that file and format it. This I was thinking of doing on the computer that's connected to the camera. On the other end, I was think of ether having another PS script also detect when the formatted image is placed in a formatted folder then opening that file in full screen mode in PS. The other option I was thinking about is having the first script also write an XML file that will be check by a Flash AcrionScript file and have the ActionScript file display the lastest image in a browser window. Any ideas what is available or easiest?
larsen67

Timelapse and displaying images automatically

Post by larsen67 »

If this were on mac then you could make use of AppleScript's "Folder Action Script" where the adding of a file to a directory triggers an event that will process the list of whatever files were added. AppleScript could launch Photoshop and process the file or it could call a JavaScript to process the file… On the new version 'CS5' I think bridge can watch a folder but I did not get the time to do any testing with this NOT seen anybody else do this yet either.
csuebele

Timelapse and displaying images automatically

Post by csuebele »

I think Lightroom also has this feature, but I don't have it. I have managed to write a script that is constantly running that checks the target file, then processes and formats any file saved to it. It then writes an XML with the photo's info. Another computer running a Flash script checks the XML on an interval and displays whatever image is noted in the XML. so far the test are working fine. It does tie up PS running the script, but I've got a dedicated computer for this project, so that is not a problem. Also a bit of a pain if you want to quit the script as it keeps looping. found that it was best to run it from ESTK then I can hit the kill button in there and it will stop right away.
larsen67

Timelapse and displaying images automatically

Post by larsen67 »

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);
csuebele

Timelapse and displaying images automatically

Post by csuebele »

This looks interesting. I used the sleep to have the script check for new files. Might have to try the scheduleTask. This will have to work with CS4, as that is what our company has at the moment, and we're not likely to upgrade to CS5 till CS6 comes out. Now is the evalFile evaluating this script or do you have some other script that it checks?

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

Timelapse and displaying images automatically

Post by larsen67 »

I was warned away from using $.sleep() I should have done some more testing while I had the chance. From what I can see in Bridge CS5 you can either supply a string containing your script or you can use the $.fileEval() Im currently unable to do any testing with other apps but don't see why this could not be used as some background timer as long as the app is left running. scheduleTask() is listed in my CS4 documentation so you should be able to test.
csuebele

Timelapse and displaying images automatically

Post by csuebele »

Your script did work in CS4, so maybe I'll have to rewrite my current script and get rid of the sleep function. Thanks!
larsen67

Timelapse and displaying images automatically

Post by larsen67 »

If you have any luck with the evalFile() then do post back as I would be interested… It does not want to work for me but I've not used it before now. Fires the script a first time then kicks back with a 'bad argument' and freezes…?
csuebele

Timelapse and displaying images automatically

Post by csuebele »

Does the same for me. Will have to look into that.
larsen67

Timelapse and displaying images automatically

Post by larsen67 »

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…