Old 03-08-2021, 04:51 PM   #41
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,214
Default

Another vote for this!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 04-10-2021, 04:05 PM   #42
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

Anyone know if it's possible to prevent Undo points in this script? I looked here https://forum.cockos.com/showthread.php?t=168746 and tried a few things, but never found a way to run this script without generating undo points:

Code:
function main() 
  reaper.defer(main)
  local ps = reaper.GetPlayState() -- 0=paused, 1=playing,2=pause,4 is recording
  if (ps&1)==0 then
    
    -- Get handle for custom action ID ------------------------
    local act = "_RSf1bfce031c736658071a00cbf202b105bbbc3505" 
    
    if string.sub(act, 1, 1) == "_" then
      act = reaper.NamedCommandLookup(act)
    end
    
    act = tonumber(act)
    ----------------------------------------------------------
    
    -- Run custom action ID ----------------------------------
    if act and act > 0 then
      reaper.Main_OnCommand(act, 0)
    end
    ----------------------------------------------------------
    
    return
  end
end

main()
benmrx is offline   Reply With Quote
Old 04-10-2021, 04:49 PM   #43
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,612
Default

Quote:
Originally Posted by benmrx View Post
Anyone know if it's possible to prevent Undo points in this script? I looked here https://forum.cockos.com/showthread.php?t=168746 and tried a few things, but never found a way to run this script without generating undo points:

Code:
function main() 
  reaper.defer(main)
  local ps = reaper.GetPlayState() -- 0=paused, 1=playing,2=pause,4 is recording
  if (ps&1)==0 then
    
    -- Get handle for custom action ID ------------------------
    local act = "_RSf1bfce031c736658071a00cbf202b105bbbc3505" 
    
    if string.sub(act, 1, 1) == "_" then
      act = reaper.NamedCommandLookup(act)
    end
    
    act = tonumber(act)
    ----------------------------------------------------------
    
    -- Run custom action ID ----------------------------------
    if act and act > 0 then
      reaper.Main_OnCommand(act, 0)
    end
    ----------------------------------------------------------
    
    return
  end
end

main()
Which script is the one behind the ActionCommandID _RSf1bfce031c736658071a00cbf202b105bbbc3505?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-10-2021, 06:59 PM   #44
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Which script is the one behind the ActionCommandID _RSf1bfce031c736658071a00cbf202b105bbbc3505?
It's this one from Reapack: Script: TJF Move Edit Cursor to Start of Razor Edits.lua

Lol..., wait a minute. I'm looking at that script now and see there's a built-in bool for making it run deferred. I'll test that out tonight.

EDIT: I just tested, and just running this script deferred is not creating undo points..., so it was definitely my own implementation that caused it. A nice learning opportunity. So, in the end..., all good. I can study this script.

Last edited by benmrx; 04-10-2021 at 09:38 PM.
benmrx is offline   Reply With Quote
Old 04-14-2021, 04:26 AM   #45
mozart999uk
Human being with feelings
 
Join Date: Nov 2010
Posts: 1,710
Default

Quote:
Originally Posted by foxAsteria View Post
Any way to do this in a Cycle Action?
I'd like to know this as well.

I've setup actions to step forward to the next bar and to step back. (A legacy from my cubase years)

Unfortunately, in order to work both when playing and when stopped, I had to make the "step back" one, a cycle action. This gets added to the undo list.

So let's say I press it 5 times to go back to a point to look at it and then want to undo what I've changed I have to press the undo key 6 times.

Any way around this?

Is there a script that I could run at various points in the cycle action to stop it going into the undo list?

Sorry - scripting newbie here
mozart999uk is offline   Reply With Quote
Old 04-14-2021, 04:59 PM   #46
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,248
Default

Quote:
Originally Posted by mozart999uk View Post
I'd like to know this as well.
It's not possible, but you can try persuading the sws devs to remove it from specific sws actions that maybe shouldn't have it.

Not a good enough fix though; we need a way to remove it wherever necessary. Such a nuisance when you use a lot of custom actions/scripts etc.
__________________
foxyyymusic
foxAsteria is offline   Reply With Quote
Old 04-15-2021, 05:08 AM   #47
mozart999uk
Human being with feelings
 
Join Date: Nov 2010
Posts: 1,710
Default

Quote:
Originally Posted by foxAsteria View Post
It's not possible, but you can try persuading the sws devs to remove it from specific sws actions that maybe shouldn't have it.

Not a good enough fix though; we need a way to remove it wherever necessary. Such a nuisance when you use a lot of custom actions/scripts etc.
Thanks. Appreciate you explaining.

Is there an FR on this already?
mozart999uk is offline   Reply With Quote
Old 04-15-2021, 05:15 AM   #48
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mozart999uk View Post
Thanks. Appreciate you explaining.

Is there an FR on this already?
For what? SWS? Their GitHub.
vitalker is offline   Reply With Quote
Old 04-15-2021, 07:02 AM   #49
mozart999uk
Human being with feelings
 
Join Date: Nov 2010
Posts: 1,710
Default

No sorry I meant the ability to set certain actions to not be recorded in the undo history.

I've searched and there's quite a few; one I'd voted on already without remembering!

https://forum.cockos.com/showthread....highlight=undo

Perhaps some people here could add their weight to it?
mozart999uk is offline   Reply With Quote
Old 04-15-2021, 08:13 AM   #50
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mozart999uk View Post
No sorry I meant the ability to set certain actions to not be recorded in the undo history.

I've searched and there's quite a few; one I'd voted on already without remembering!

https://forum.cockos.com/showthread....highlight=undo

Perhaps some people here could add their weight to it?
Oh, I've added there a link to a similar FR: https://forum.cockos.com/showthread.php?t=119798
vitalker is offline   Reply With Quote
Old 04-15-2021, 08:24 AM   #51
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,093
Default

Quote:
Originally Posted by mozart999uk View Post

Unfortunately, in order to work both when playing and when stopped, I had to make the "step back" one, a cycle action. This gets added to the undo list.
What does the cycle action contain exactly?
nofish is offline   Reply With Quote
Old 04-16-2021, 02:23 AM   #52
mozart999uk
Human being with feelings
 
Join Date: Nov 2010
Posts: 1,710
Default

I've attached a screenshot.

It uses two actions that I've created - bit of a kludge but only way I could get it to work....

I guess I could write a script to do the whole thing, then perhaps include some of the anti-undo suggestions mentioned above.....
Attached Images
File Type: png step back bar cycle action.png (11.4 KB, 72 views)

Last edited by mozart999uk; 04-16-2021 at 02:28 AM. Reason: added something
mozart999uk is offline   Reply With Quote
Old 04-16-2021, 02:28 AM   #53
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mozart999uk View Post
I've attached a screenshot.

It uses two actions that I've created - bit of a kludge but only way I could get it to work....

I guess I could write a script to do the whole thing, then perhaps include some of the anti-undo suggestions mentioned above.....
What's inside these two custom actions?
vitalker is offline   Reply With Quote
Old 04-16-2021, 02:34 AM   #54
mozart999uk
Human being with feelings
 
Join Date: Nov 2010
Posts: 1,710
Default

Quote:
Originally Posted by vitalker View Post
What's inside these two custom actions?
Attachments included
Attached Images
File Type: png step back bar if playback is enabled.png (6.0 KB, 68 views)
File Type: png step back bar if playback is stopped.png (3.2 KB, 54 views)
mozart999uk is offline   Reply With Quote
Old 04-16-2021, 03:08 AM   #55
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by mozart999uk View Post
Attachments included
Not sure, but try to uncheck this: Preferences -> General -> Undo settings -> Include selection -> cursor position.
vitalker is offline   Reply With Quote
Old 04-16-2021, 03:18 AM   #56
mozart999uk
Human being with feelings
 
Join Date: Nov 2010
Posts: 1,710
Default

Quote:
Originally Posted by vitalker View Post
Not sure, but try to uncheck this: Preferences -> General -> Undo settings -> Include selection -> cursor position.
Thanks for the suggestion. Unfortunately it was already unticked 😊
mozart999uk 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 12:24 AM.


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