[SOLVED] Avoiding “Save project” and “Delete Captured Media” when closing project
-
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!