Reason Auto Save Workaround/Solved (Mac-only)

This forum is for discussing Propellerhead's music software. Questions, answers, ideas, and opinions... all apply.
User avatar
Jeromi Richmond
Posts: 5
Joined: 14 Dec 2018

Post 14 Dec 2018

Hello all, yet another avid reason user here frustrated for the last time... I spent a couple hours on a song I really got into and...boom...reason crashed and lost all progress....SOOOOO i decided to build my own service/app that will press save every 5 min or whatever interval you want and is automated to start whenever reasons is launched. It consist of the service...which is a keystroke command on repeat and delayed 5min...And a workflow app built on automator that opens the app and starts the service, though key commands as well...its been successful up to this point and i want to share with it with the world but this is my first post on here and don't want to get booted for taking initiative and coming up with a solution that imo should have been solved ages ago...sooooo I'll post the code and I guess you guys can go in and make the app/service on your own... It should take less than 5 mins to build and install right but afterwards you shouldn't have to worry about Command +S any more... and Ps it took me about 5 days to look up how all of this works and the results are there..however I don't consider myself a developer so if anyone who is wants to add input please do...would like to see this grow to the fullest potential... somewhere along the lines of Protools and how it handles its backup files...but that in itself is another beast to be slain...another day...

So First off the Loop service...
In Automator create a new service and add a run applescript action.. (search for "Run" in the actions tab)...also make sure "no input" and "any application" are both selected...I tried doing it for just reason but didn't work out as I planned. Once you're done copy and paste the code below where u see (* Your script goes here *). The first tell and the last end tell are the instructions...On run, return input, and end run are already typed in

on run {input, parameters}

tell application "System Events"
repeat
if exists process "Reason" then
tell application "Reason"
activate
end tell
tell application "System Events"
keystroke "s" using {command down}
end tell
delay 300
else
exit repeat
end if
end repeat
end tell
return input
end run

Once that's done name it and save it.
Now go to the services tab (usually in the apps drop down menu)...and go to services preferences. Here if you scroll down to general you should see your service. Click next to it and create a unique shortcut that will not interfere with any other shortcuts in reason...oh and side note shortcuts for services can be a little buggy but I found out for my version of Osx (10.10) Yosemite I have to include "command" within the shortcut or it wont work properly. So in my case I chose "Command+control+shift+s.... Now we have the service that's gonna press command + s for you until you close the program..

Now we need to create an app that will open reason and hit the shortcut to start to the service...

Open automator and create an application click finder (in the actions tab) and add a "launch application" action... then search for run...and add run applescript right after that...I also moved reason out of the folder directly into the applications folder to make things easier... Select Reason for the "launch application" part and then paste this code inside of the "Run applescript" part.

on run {input, parameters}
delay 10
tell application "System Events"
keystroke "s" using {command down, control down, shift down}
end tell
return input
end run

Ps the delay in the service script is set to 300 seconds which equals 5 min...set that to whatever u like in seconds...and the second delay is to give reason time to startup ....That can change depending on how fast or slow your startup is...

So the app that was built last will replace your reason shortcut in the dock...I also copied and pasted the icon in "get info" to make it more legit lol but up to you how far you want to take it...So now when you click the new Reason app (the automator app) it should open up Reason and hit the key command for the auto save service to open ... A save prompt will popup to save it for the first time (if you want... add a delay in the beginning below on run to give yourself time to get rolling but im use Pro tools quite often so it doesn't bother me) ...So the only drawback is you have to save the project right off the bat instead of waiting until you're halfway thru or until it crashes...lol

I hope this reaches as many users as possible and i also hope the reason folks dont come looking for me...lol
and im also taking suggestions for an improvised version... hope this helps

Cheers
ps Im thinking about making a youtube video and posting the files there
Last edited by Jeromi Richmond on 17 Dec 2018, edited 2 times in total.

User avatar
Jeromi Richmond
Posts: 5
Joined: 14 Dec 2018

Post 14 Dec 2018

So im including both the files but remember my the actual reason app is directly inside the applications folder and the service should be placed in the system/library/services folder...make sure finder is selected..hold option and click go at the top...it should appear right in the middle...oh and the Automator app Reason AS will be used to activate the auto save function...the forum wont let me upload so i threw it in google drive...good luck

User avatar
challism
Posts: 1498
Joined: 17 Jan 2015

Post 17 Dec 2018

This looks really useful. Somehow it hasn't gotten any attention, or has been buried beneath other topics. I'm going to bump this to the top now so maybe people can see it and have a look. Thanks for your hard work in putting this together, and sharing with us here in ReasonTalk, Jeromi.

User avatar
Jeromi Richmond
Posts: 5
Joined: 14 Dec 2018

Post 17 Dec 2018

np.......lol and appreciate you as well

User avatar
selig
Moderator
Posts: 7815
Joined: 15 Jan 2015

Post 17 Dec 2018

I’m assuming this is Mac only - you should put that information front and center if so.

Also wondering how easy this is to turn on/off? Only used Automator a few times… Thinking for some uses you may not want to interrupt playback with a save (only in cases where you’re close to the CPU limit). Maybe it’s a non-issue, just thinking out loud.

Also, may make more sense as a Save As, in cases where you don’t want to overwrite the existing file. Plus the dialog popping up reminds you what’s going on behind the scenes. I suggest this because most of the time you want a breadcrumb trail with this type of feature, not just a hard overwrite of the one and only file.

Also, what happens after a manual save, does the counter restart?

Ideally what I’d want is a “save every x minutes, keeping y versions” (this is how Pro Tools works). And ideally, if you don’t make any changes there should be no saving.

I realize much if not all of this is beyond what Automator can accomplish, just putting it out there to bump the thread and keep the conversation going.

And as I’ve mentioned regularly since Reason 6 added audio, would be GREAT to save the session data without having to save all audio data too, but that’s a whole different discussion!


Sent from some crappy device using Tapatalk
Selig Audio, LLC

User avatar
Jeromi Richmond
Posts: 5
Joined: 14 Dec 2018

Post 17 Dec 2018

Thanks for the feedback Selig...Just to answer a couple questions...it's pretty easy to turn off...once the service is started... a spinning cog will pop up in the top right toolbar...click it and close it to turn just the service off (I wish it had a pause option)..the save while playback i haven't considered till now (in fact just tried it and it doesn't stop playback)....yesssssss...

As far as the counter being reset thats a negative....the service has nothing to do with what's going on in Reasons ...it's literally repeating the "save" keyboard shortcut until the user turns it off or reason closes and the service does not detect reason. I am noticing however that as i'm typing the service is working the same way for my chrome browser, so gonna have to go back in and figure out how to tell it to only execute the key command for reason.I see now how tedious and time consuming programming can be and i'm just scratching the surface...lol

I've already considered vaguely whats required for a "protools" style session backup function. First off the self contain option would have to be off that way were not saving copies of large sessions over and over again... Also there would have to be a "session backup folder created on the first save of every session and that folder placed within the original folder of the session...(I found the instructions online for that, its just pretty lengthy). Along with that each new "save as" would have to be separately named in some type of chronological order... which i've also found how to name each new file created automatically...but i've yet discovered how to apply a time and date stamp.

I used applescript for the most part and transferred the scripts into automator to streamline the process. I'm waiting on some true developers to chime in but i know it can be done...If i am able to accomplish the full spectrum of what were all looking for...i might get bold enough and respectfully contact the guys at propellerhead to see how they feel about implementing...i'm sure their more than capable of doing it themselves...and who knows what those guys have going on over there...however if the work is done and the people like it...what more can they say other than...Appreciate it...job well done...oooor....go "F" yourself...lol highly doubt it but worth a try right

User avatar
ScuzzyEye
Posts: 1305
Joined: 15 Jan 2015

Post 18 Dec 2018

I was thinking the normal Save would be fast enough to not really interrupt playback. I'd be worried about a Save As... though. Especially for projects with a lot of audio. A simple save, only writes changes, to the end of the file at that, so it is really quick. A Save As... has to re-allocate all the disk space again for a new copy.

It'd be a good experiment to try, but I wouldn't go too deep down the creative file naming, until you check the performance of creating a new file.

User avatar
selig
Moderator
Posts: 7815
Joined: 15 Jan 2015

Post 18 Dec 2018

ScuzzyEye wrote:I was thinking the normal Save would be fast enough to not really interrupt playback. I'd be worried about a Save As... though. Especially for projects with a lot of audio. A simple save, only writes changes, to the end of the file at that, so it is really quick. A Save As... has to re-allocate all the disk space again for a new copy.

It'd be a good experiment to try, but I wouldn't go too deep down the creative file naming, until you check the performance of creating a new file.
Any “Save As” pops a dialog, at which case you have three options: give it a new name, keep the same name and overwrite (same as save), or cancel and wait for the next push.


Sent from some crappy device using Tapatalk
Selig Audio, LLC

mcatalao
Posts: 990
Joined: 17 Jan 2015

Post 19 Dec 2018

This is mac only but perfectly doable with autohotkey and windows scheduler.

I might give it a try in the weekend and put a version here.

Ps. : glad to see someone else automating over reason. I already have a bunch of stuff automated, from exporting even to stuff related to controlling and mixing.

Some of it is really complex stuff involving a lot of mouse clicks and picture recognition but it works great.

Another example I did is exporting a master between locators then integrate it with lame Mp3 encoder and send the file to a client.

Sent from my WAS-LX1A using Tapatalk




mcatalao
Posts: 990
Joined: 17 Jan 2015

Post 19 Dec 2018

Hi!

So i created a little autohotkey program to do this, if you want to try it out, you can download the autohotkey program from this site:

www.autohotkey.com

and use the following script:

SetTitleMatchMode, 2 ;
IfWinExist ahk_exe reason.exe
{
WinActivate, Mixer
Send ^s

}


If you want a more complete script with tool tips:

SetTitleMatchMode, 2 ;

IfWinExist ahk_exe reason.exe
{
WinActivate, Mixer
Send ^s

showTooltip("Yellow", "Black", "Reason Song Saved")
}

sleep 5000

ExitApp
Return



showTooltip(tpColor, fontColor, Text)
{

SetTitleMatchMode, 2 ;
WinActivate, Mixer
CoordMode, ToolTip, screen ; makes tooltip to appear at position, relative to screen.
ToolTipColor(tpColor, fontColor)
tooltip %Text%, 820, 5, 1 ; display tooltip of %xx% %yy% at coordinates x0 y0.
}


;================= Code For tooltip ============================================



; ToolTipOpt v1.004
; Changes:
; v1.001 - Pass "Default" to restore a setting to default
; v1.002 - ANSI compatibility
; v1.003 - Added workarounds for ToolTip's parameter being overwritten
; by code within the message hook.
; v1.004 - Fixed text colour.
ToolTipFont(Options := "", Name := "", hwnd := "") {
static hfont := 0
if (hwnd = "")
hfont := Options="Default" ? 0 : _TTG("Font", Options, Name), _TTHook()
else
DllCall("SendMessage", "ptr", hwnd, "uint", 0x30, "ptr", hfont, "ptr", 0)
}
ToolTipColor(Background := "", Text := "", hwnd := "") {
static bc := "", tc := ""
if (hwnd = "") {
if (Background != "")
bc := Background="Default" ? "" : _TTG("Color", Background)
if (Text != "")
tc := Text="Default" ? "" : _TTG("Color", Text)
_TTHook()
}
else {
VarSetCapacity(empty, 2, 0)
DllCall("UxTheme.dll\SetWindowTheme", "ptr", hwnd, "ptr", 0
, "ptr", (bc != "" && tc != "") ? &empty : 0)
if (bc != "")
DllCall("SendMessage", "ptr", hwnd, "uint", 1043, "ptr", bc, "ptr", 0)
if (tc != "")
DllCall("SendMessage", "ptr", hwnd, "uint", 1044, "ptr", tc, "ptr", 0)
}
}
_TTHook() {
static hook := 0
if !hook
hook := DllCall("SetWindowsHookExW", "int", 4
, "ptr", RegisterCallback("_TTWndProc"), "ptr", 0
, "uint", DllCall("GetCurrentThreadId"), "ptr")
}
_TTWndProc(nCode, _wp, _lp) {
Critical 999
;lParam := NumGet(_lp+0*A_PtrSize)
;wParam := NumGet(_lp+1*A_PtrSize)
uMsg := NumGet(_lp+2*A_PtrSize, "uint")
hwnd := NumGet(_lp+3*A_PtrSize)
if (nCode >= 0 && (uMsg = 1081 || uMsg = 1036)) {
_hack_ = ahk_id %hwnd%
WinGetClass wclass, %_hack_%
if (wclass = "tooltips_class32") {
ToolTipColor(,, hwnd)
ToolTipFont(,, hwnd)
}
}
return DllCall("CallNextHookEx", "ptr", 0, "int", nCode, "ptr", _wp, "ptr", _lp, "ptr")
}
_TTG(Cmd, Arg1, Arg2 := "") {
static htext := 0, hgui := 0
if !htext {
Gui _TTG: Add, Text, +hwndhtext
Gui _TTG: +hwndhgui +0x40000000
}
Gui _TTG: %Cmd%, %Arg1%, %Arg2%
if (Cmd = "Font") {
GuiControl _TTG: Font, %htext%
SendMessage 0x31, 0, 0,, ahk_id %htext%
return ErrorLevel
}
if (Cmd = "Color") {
hdc := DllCall("GetDC", "ptr", htext, "ptr")
SendMessage 0x138, hdc, htext,, ahk_id %hgui%
clr := DllCall("GetBkColor", "ptr", hdc, "uint")
DllCall("ReleaseDC", "ptr", htext, "ptr", hdc)
return clr
}
}

To create the script, just right click on the desktop and create an AHK file. Open it with and paste the code there. If the code works, then you just have to create a windows scheduler task for it.

Good Luck!

User avatar
Noplan
Posts: 635
Joined: 16 Jan 2015
Location: Cologne, Germany

Post 20 Dec 2018

that will press save every 5 min
the problem is that you can not undo the steps that are saved. If you make a mistake in your project, it will be saved and you will no longer have the starting values.

User avatar
selig
Moderator
Posts: 7815
Joined: 15 Jan 2015

Post 20 Dec 2018

Noplan wrote:
that will press save every 5 min
the problem is that you can not undo the steps that are saved. If you make a mistake in your project, it will be saved and you will no longer have the starting values.
Agreed!
That’s exactly why I suggested “save as” instead of save. That way it becomes more of a reminder that pops up and gives you the option to save, save as, or dismiss. We all need a little reminder to save at times…

Incremental saves are what is really needed in Reason IMO.

Sent from some crappy device using Tapatalk
Selig Audio, LLC

mcatalao
Posts: 990
Joined: 17 Jan 2015

Post 20 Dec 2018

Noplan wrote:
20 Dec 2018
that will press save every 5 min
the problem is that you can not undo the steps that are saved. If you make a mistake in your project, it will be saved and you will no longer have the starting values.
Are you sure about this? I thought this was true ONLY if you closed and reopened the project.

As for Selig "Save As" proposal i understand the idea (it's actually doable with AHK) but its way more intrusive, and a hdd killer on any context for big audio track based projects.

I can do it if you want though (for windows)!

User avatar
challism
Posts: 1498
Joined: 17 Jan 2015

Post 10 Feb 2019

One of my computers has recently been acting up and the screen will turn yellow, green, or blue (depending on it's mood, I guess?) and I basically lose all control over it and have to hard restart it. So if I'm in the middle of a new song or something, I will totally lose it. This might be a good solution until I can figure out what the hell is going on. Maybe I need a new video card?

Thanks for writing these apps for us, guys! They are very much appreciated.

User avatar
Jeromi Richmond
Posts: 5
Joined: 14 Dec 2018

Post 11 Feb 2019

just glad i can help

RandyEspoda
Posts: 242
Joined: 14 Mar 2017

Post 12 Feb 2019

With autoIt you can do this easily for Windows too..

User avatar
sublunar
Posts: 418
Joined: 27 Apr 2017

Post 12 Feb 2019

I don't understand why you'd bother going through this much effort when you could just take control of your own destiny and save your progress yourself.

Maybe I'm just weird, but any time I make any significant changes to any project in any program I'm using, I either "save" or "save as". It's like an involuntary reflex. Maybe I've just used computers long enough to know they can't be trusted?

RandyEspoda
Posts: 242
Joined: 14 Mar 2017

Post 12 Feb 2019

sublunar wrote:
12 Feb 2019
I don't understand why you'd bother going through this much effort when you could just take control of your own destiny and save your progress yourself.

Maybe I'm just weird, but any time I make any significant changes to any project in any program I'm using, I either "save" or "save as". It's like an involuntary reflex. Maybe I've just used computers long enough to know they can't be trusted?
Mistakes are very easily made, and a save reflex is sometimes simply too late, God knows I've had it happen to me several times, and I suspect that's the case for almost everyone. If you say you never did, then you're probably lying. I've been constantly saving every change in a project for years but still this sometimes happens. If you say it never does for you, you're probably not being perfectly honest. Just saying. :mrgreen:

mcatalao
Posts: 990
Joined: 17 Jan 2015

Post 14 Feb 2019

RandyEspoda wrote:
12 Feb 2019
With autoIt you can do this easily for Windows too..
Randy the example i put is for windows, with AutoHotKey. I have to have a try at AutoIt, as it seems it has a nicer programming language!

olive6741
Posts: 146
Joined: 11 May 2016

Post 25 Feb 2019

Jeromi Richmond wrote:
14 Dec 2018
Hello all, yet another avid reason user here frustrated for the last time... I spent a couple hours on a song I really got into and...boom...reason crashed and lost all progress....SOOOOO i decided to build my own service/app that will press save every 5 min or whatever interval you want and is automated to start whenever reasons is launched.

(...)
Very nice thanks!

Had to solve some privacy settings in MacOS as I'm on Mojave - it's a bit more tricky - (and some Automator types of documents to create seem to have a different name under this OS), but finally it works!

And it seems to me undo is still possible after a simple 'Save' (as it is what it does finally). From what I see, undo history is intact since first loading a file. Doing Cmd-S has no impact on Undo history.
But someone will correct me if I'm wrong. I tend to try dodgy VST sometimes, so it is a very nice addition... :)

(hope 'Dodgy' is not a too rude word, I remember it from some trips in the UK in the 90s :) )

If someone needs info on what extra steps are needed to make it work on Mojave, just tell me.

  • Information
  • Who is online

    Users browsing this forum: CommonCrawl [Bot] and 1 guest