Using the Applescript "capture" command

Can someone fill me in on the correct syntax to do this? Is it just

tell application “iStopMotion” to capture

or is there more to it than that?

Thanks!

Because iStopMotion is a document based application you have to tell the application in which document it should trigger the capture action even if there is only one document open. Here is a little example:

tell application “iStopMotion”

set theDocuments to documents

tell item 1 of theDocuments to capture

end tell

The variable “theDocuments” will contain all the documents that are currently open in iStopMotion. “item 1 of theDocuments” will just address the first random one in the list.

Stupendous! Thanks so much!

Also, just to check: there’s no applescript action for “Play”, is there? I’ve been using “tell process to click menu item of menu of menu bar etc etc etc”, which seems to be slightly buggy. I’ll probably just switch over to having System Events press “P”, as that seems to be somewhat more stable, but if the Play command were accessible to AppleScript, it’d be that much better.

Thanks again!

This AppleScript should trigger the playback button, but unfortunately the “perform shortcut action named” command seems to be broken. Sorry for that! We are going to fix it in a future version.

tell application “iStopMotion 3.0.2”

set theDocument to first item of documents
set theAction to perform shortcut action named "play/stop movie"

tell theDocument to perform shortcut action theAction

end tell

However, this broken AppleScript example reveals which action should be possible: “capture”, “capture one frame”, “capture two frames”, “capture three frames”, “capture four frames”, “capture one still cam frame”, “capture stillpreview”, “go to beginning”, “go to previous frame”, “go to next frame”, “go to end”, “play/stop movie”, “present movie”, “toggle loop”, “toggle play selection only”, “send to final cut pro”, “send to i movie”, “show only movie”, “show preview and movie”, “show only preview”, “blinking off”, “blinking slowest”, “blinking slow”, “blinking medium”, “blinking fast”, “blinking fastest”, “toggle mark blinking preview”, “switch onion skinning off”, “onion skin 1 frame”, “onion skin 2 frames”, “onion skin 3 frames”, “onion skin 4 frames”, “onion skin 5 frames”, “zoom to fit”, “zoom to actual”, “increase zoom”, “decrease zoom”, “sidebar recording”, “sidebar view”, “sidebar compositing”

Oooh, I’ll look forward to the day that works! Meanwhile, I switched over to "tell System Events to keystroke ‘p’ ", and that seems to be working just fine. Thanks again for your help.