[SOLVED] Avoiding “Save project” and “Delete Captured Media” when closing project
-
Hi,
I’m making a video installation project that includes “Capture Stage to Disk” processes and some numerical (counter) processes. Therefore, when quitting the patch, Isadora asks (1) if I want to delete/retain all the captured media and (2) if I want to save the project or not.
I want to program the project to automatically (on selected days) open in the morning and close in the evening. There’s no challenge opening the project, but closing/quitting Isadora becomes more complicated because of Isadora asking (1) delete/retain captured media and (2) save the project or not.
When quitting Isadora, I do not want to delete the captured media and I don’t want to save the project (although saving the project would not be a big deal). But I want Isadora and my computer to be able to do starting/stopping the project automatically, and these “pop-up” selection windows make it impossible (without someone manually selecting the options).
The only ways I have found to avoid these “pop-up” selection windows is to Force-Quit Isadora – or in a case of a “crash”. Or maybe I just haven’t found them (at least there’s none in the preferences)?
Is there a way I can “preselect” and avoid the option “pop-ups” when closing Isadora? Any ideas would be appreciated. Working now on Isadora v3.0.2.
Thanks in advance!
-
this would be a worthwhile feature request. Unfortunately there are no preference settings to control this. The only qay I can think around this would be to find some sort of hotkey/macro type software and schedule a script to run (via the OS) that closes isadora and 'clicks' the required buttons.
-
on a mac you could record a mouse movement with automator. So it would click automatically to not safe the movies or the project.
Best Michel
-
@DusX @Michel Thousand thanks for your replies and advice!
The "work around" sounds a bit complicated at first (at least not simple), but might try that procedure.
I would think my case is not a unique one, so I think it would be a good feature to be included to Isadora ("preselected" options of saving/not saving project and deleting/not deleting media). There must be a lot of people using Isadora for long-time installation, so I would imagine it would benefit many. The project could be saved as a special format (like now one can "Save as Run Only").
Would it be complicated to include this feature to Isadora? Should I make an "official" feature request?
Thanks again!
-
Yes please make an official feature request over the form on the website. https://support.troikatronix.c...
Best Michel
-
@michel said:
on a mac you could record a mouse movement with automator. So it would click automatically to not safe the movies or the project.
Easier than this (and safer in case the resolution changed or the dialog showed up somewhere different) is using Automator with a timed event that just tells Isadora to forcequit. (There's also multiple ways to do all this so google is your friend to find other Applescript + timed event + forcequit options.)
Simple script (without the timed event bit) would be:
tell application "Isadora" to quit saving no
or
tell application "Isadora 3" to quit saving no"
You can also go the route of having Applescript press specific buttons on specific dialogs or simulate the necessary keypresses for forcequitting.
-
Here's another solution I did last night that presses the buttons of the dialog for you. It's useful to note that almost any macOS app's dialogs, menus, etc. can be scripted by sending messages to System Events, as @Michel pointed out in his link above.
This script is directly aimed at the issue brought up by the original poster. It assumes the following:
1) The Isadora file is "dirty" -- meaning it will ask to save the file. (Always true if you've recorded at movie using Capture Stage to Movie or Capture Camera to Movie)
2) The "Do you want to delete captured media" dialog will appear. (Always true if you've recorded at movie using Capture Stage to Movie or Capture Camera to Movie)Again, this is for AppleScript and thus a MacOS only solution. I don't know of an equivlent on Windows, though maybe @DusX does.
-------- APPLESCRIPT STARTS HERE --------
tell application "System Events"
tell application "Isadora"
activate
end tell
tell process "Isadora"
-- after a short delay, click the close button in the window
delay 0.5
click button 3 of window 1
-- after a short delay, click the "Yes" button of the "Save Captured Media" warning
-- this will delete all of the captured media
delay 0.5
click button "Yes" of window 1
-- after a short delay, click the "Don't Save" button of the "Save File" warning sheet
delay 0.5
click button 2 of sheet 1 of window 1
end tell
end tell-------- APPLESCRIPT ENDS HERE --------
Best Wishes,
Mark -
-
@mark @Woland @Michel Thousand thanks for your replies!
I tried the script but running it gets the following error: error "System Events got an error: Script Editor is not allowed assistive access." number -1719 from window 1 of process "Isadora".
So, what I did (after having run my patch with capturing stage) was quitting Isadora (then the first pop-up comes up) and then running Mark'sCloseNoSave.scpt, resulting to the above error message in script editor.
When quitting my project (as initially described), it brings two pop-ups:
In this order. And the marked buttons are the ones I want. So, don't delete files and don't save the project.
Thanks again!
-
@lauri said:
Script Editor is not allowed assistive access
Google is your friend: https://stackoverflow.com/questions/31019916/is-not-allowed-for-assistive-access-error-when-running-applescript-from-java
-
Try tweaking this version
LWSQuitKeepMediaNoSave.scpt.zip
An easy way to actually see what's happening is to slow it all down by changing each "delay 0.5" to "delay 2" so each action takes longer.
-
-
@michel said:
there is an error in the code
No surprise there. I write frankenstein applescript cobbled together from different places and then just tweak things until it does what I want. Couldn't test that one in full because I'm on the orders computer which doesn't have a license different dialogs show up when quitting Isadora.
Also worth noting that you'll need to change the name of the Isadora application specified at the top when you move to different versions.
Best wishes,
Woland
-
@Michel @Woland Thousand thanks again!
Great! Michel's (...NoSave2.scpt) version work well!!!
And thanks for noting about the Accessibility section, I had ScriptEditor in the list but had forgotten to checkmark it. Sorry, my fault.
---
Well, another question, would there be any way to launch the script from Isadora? (Just figuring out simple/secure ways to handle timing.)
To preserve the functionality of my patch, the Stage Captures have to run a certain length, so closing the patch is triggered when the capture has ended (and then the patch jumps to an empty stage, and Isadora can then be closed). Ending the patch/captures is easy to get timed within Isadora, but it would be convenient to launch the closing script from the same timing. Of course there could be a reasonable time difference from estimated patch ending and script launch, but it would be nice if launching the script could be initiated from Isadora. Possible?
Thanks!
-
@lauri said:
Well, another question, would there be any way to launch the script from Isadora? (Just figuring out simple/secure ways to handle timing.)
I'm afraid, for security reasons, we don't allow that. Otherwise someone evil could launch an AppleScript to do nasty things to your computer, e.g., erase your hard drive.
You can however write applescripts that monitor the contents of a folder, looking for a file to appear. So one way would be to use the Data Array actor to write a file to disk -- even if the file has no actual contents. When the AppleScript sees that file appear in the folder, it could then do something else. So that's one way to trigger an AppleScript from Isadora.
I'm sorry but I don't have time at the moment to write this for you. But if you want to try yourself, read this Apple article on "Folder Actions."
Best Wishes,
Mark -
@mark Thousand thanks for your advice! Great! I will look into it.
-
The other thing you could do is make the applescript into an .app file, make it a startup item, have it open Isadora and use the time of day function to trigger the closing and opening of Isadora at whatever time intervals you want.
-
@woland said:
The other thing you could do is make the applescript into an .app file, make it a startup item, have it open Isadora and use the time of day function to trigger the closing and opening of Isadora at whatever time intervals you want.
Also an excellent and probably easier suggestion if it works for you @Lauri
Best Wishes,
Mark -
@Woland @mark Thank you again for your replies!
Yes (AppleScript as an .app and make it as a startup item), that’s the way I usually have dealt with the installation projects.
The thing is that I need to sync the close-down with the stage captures. The captures really need to be fixed length, so an arbitrary shut-down doesn’t work.
But yes, I can initiate also the close-down Isadora procedure by sending a timed key (for instance “X”) from the AppleScript app (registered by Key Table Watcher actor, which triggers the close-down procedure), and then make the AppleScript app wait for at least the length of the capture cycle, before closing the project/Isadora – not deleting files, not saving patch. (So, all the timing would actually come from the AppleScript app.)
Thanks again!
-
@lauri said:
But yes, I can initiate also the close-down Isadora procedure by sending a timed key (for instance “X”) from the AppleScript app (registered by Key Table Watcher actor, which triggers the close-down procedure), and then make the AppleScript app wait for at least the length of the capture cycle, before closing the project/Isadora – not deleting files, not saving patch. (So, all the timing would actually come from the AppleScript app.)
Excellent Idea. Let us know if it works!