Old 07-28-2021, 03:40 AM   #1
fripholm
Human being with feelings
 
Join Date: Jan 2011
Posts: 69
Default Command that returns previous Reaper GUI actions?

Sorry for the noob question but I don't know where to start looking for answers.

Let's say, I wanted a script to know that the user changed a send volume with the mouse and then do something with this information.

Is there a command that returns previous Reaper GUI actions (something like "last action was sendvol -12dB on sendidx XX on track YY", overly simplified!) or do I have to continuously scan all track sends for changes to achieve this?
fripholm is offline   Reply With Quote
Old 07-28-2021, 10:49 AM   #2
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,417
Default

There are API calls to get last touched track, and last touched FX. Probably with those you can implement the behavior you want.

GetLastTouchedFX()
GetLastTouchedTrack()

You could also try reading the undo history. I am not sure exactly how to do that, but there are a bunch of "Undo_*" API calls available.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 07-28-2021, 10:20 PM   #3
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,992
Default

You can get the last action user did with
Code:
  last_action = reaper.Undo_CanUndo2( proj )
more about: https://www.extremraym.com/cloud/rea...#Undo_CanUndo2

if you want to trigger your script when certain action was done by the user you need to constantly check the last performed action in a defer loop .

more about defer loops :

https://forum.cockos.com/showpost.ph...99&postcount=7
and
https://forum.cockos.com/showpost.ph...2&postcount=21
from (MESPOTINE, Meo)
daniellumertz is online now   Reply With Quote
Old 07-29-2021, 12:29 AM   #4
fripholm
Human being with feelings
 
Join Date: Jan 2011
Posts: 69
Default

Thanks guys! Will check it out.

EDIT: Unfortunately, GetLastTouchedTrack() only triggers upon clicking on the track, changing track volume or soloing, muting etc. It does not update when just touching/changing send levels.

Will check out the undo functions later.

Last edited by fripholm; 07-29-2021 at 03:40 AM.
fripholm is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.