Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 09-15-2019, 04:08 PM   #1
kenm
Human being with feelings
 
Join Date: Dec 2011
Location: San Jose, CA, USA
Posts: 84
Default NamedCommandLookup() for a ReaScript Action doesn't work in __startup.lua on Mac Only

Sorry for the longish title.

Reaper v5.983/64 for Mac

I'm trying to launch a ReaScript at Reaper startup that uses defer() and rather than using dofile, which keeps the __startup.lua script running forever, I wanted to trigger an action.

The following code in __startup.lua shows an int for "val" on a Windows machine but on a Mac it always show '0':

Code:
val = reaper.NamedCommandLookup("_RSf8e4f6430c6d03c69b2d5f2519ef97465317e503")
reaper.ShowConsoleMsg(tostring(val))
Also, it does appear to work correctly for built-in actions such as "Transport: Play", just not actions associated to a ReaScript.

Code:
val = reaper.NamedCommandLookup("1007")
Please let me know what additional information is needed.

Thanks,
Ken
kenm is online now   Reply With Quote
Old 09-15-2019, 04:55 PM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,252
Default

This seems to work as expected here, on a mac.

schwa is offline   Reply With Quote
Old 09-15-2019, 05:17 PM   #3
kenm
Human being with feelings
 
Join Date: Dec 2011
Location: San Jose, CA, USA
Posts: 84
Default

Grrr. I forgot to mention that it works if Reaper is already up and running. It's only on a cold startup.

Also, I'm on MacOS 10.14.6 in case that matters.

I reproduced the problem on a completely "virgin" Mac so it's not something specific to one system.

Ken
kenm is online now   Reply With Quote
Old 09-15-2019, 05:44 PM   #4
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,252
Default

The screenshot above is from a cold start, after which I opened the editor to show __startup.lua.
schwa is offline   Reply With Quote
Old 09-15-2019, 06:30 PM   #5
kenm
Human being with feelings
 
Join Date: Dec 2011
Location: San Jose, CA, USA
Posts: 84
Default

I just knew it wasn't going to be THAT simple.

Let me put more work into narrowing it down and I'll post back.

Thanks,
Ken
kenm is online now   Reply With Quote
Old 09-16-2019, 09:27 AM   #6
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,558
Default

Could you try older versions of Reaper as well?
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 09-16-2019, 03:45 PM   #7
kenm
Human being with feelings
 
Join Date: Dec 2011
Location: San Jose, CA, USA
Posts: 84
Default

Sorry for the delay. A work emergency took priority this morning. Unfortunately, by the time I got back, there had been a power outage and both MBPs had gone to sleep. After waking them up the problem is no longer reproducible.

I'll keep an eye out and let you know if it comes back. Any pointers on what to capture if the problem does come back?

Thanks,
Ken
kenm is online now   Reply With Quote
Old 09-17-2019, 05:16 AM   #8
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,558
Default

That's indeed weird.

The best thing you can do: when the problem occurs again, see what you've done/changed between the last time you've run Reaper without problems and this time, where Reaper has these problems.

Oh, and you could build in a check in your __startup.lua. Every time NamedCommandLookup returns 0, although it should return something else, pop up a message:

reaper.MB("Here we go again: The Bug has returned!", "A Bug's Life", 0)

This should give you an indicator to when the problem rearrives.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine 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 02:00 PM.


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