justin = { main feed , music , code , askjf , pubkey };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.


Name: Ask: Human (enter yes):
[back to index] | [unreplied] | [replied] | [recent comments] | [all]

Question: Is there any problem to use AddRemoveReaScript (add = true ) to get the command ID of a script, that is already present in the Action List, by its path?
Asked by amagalma (194.150.167.x) on March 13 2022, 5:36pm
Reply on March 13 2022, 8:34pm:
    Not a problem exactly but also it's pretty inefficient, does a lot of extra work. If you can do a sha1 you can calculate the command ID string using that...


Comments:
  • Posted by amagalma (91.240.243.x) on March 14 2022, 8:45am:
    Thanks! But what exactly do I have to pass to the sha1 function? No matter what I've tried I didn't get the same hash as the command ID. Could you give an example with the cockos theme adjuster? (Default_6.0_theme_adjuster.lua) Thanks!

  • Posted by Justin on March 14 2022, 12:51pm:
    Take the relative path, e.g. Cockos/Default_6.0_theme_adjuster.lua (or full path if not in the reascript/ dir), convert to uppercase, convert any backslashes to /, take the SHA1 of that (not including the nul character at the end), then "RS" or "RS%x_" (sectionID) prefix, and %02x for each of the 20 bytes of the SHA1

  • Posted by amagalma (37.6.214.x) on March 14 2022, 2:55pm:
    Thank you very much! :)


Comment:
    Your Name:   -- Site Owner's Name:  (for human-verification)

    Comment:    

    
  
[back to index] | [unreplied] | [replied] | [recent comments] | [all]
Copyright 2022 Justin Frankel. | RSS