Old 02-11-2017, 03:03 AM   #1
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 410
Default Export Command IDs

Hey Guys,

Anyone know of a way to export a list of all SWS/S&M extension, and custom action/script command IDs? I know how to return an ID via NamedCommandLookup(), however I need a solution to return them all to a text file with each command and it's current ID on a sperate line.
Something like this:

[COMMANDS]
_S&M_TGL_LOOPMEDIA_SELTRACK1=55490
_744689a4a22f1b429c4d7809469d3d16=55853
...etc.


Thank you
NextLevel is offline   Reply With Quote
Old 02-11-2017, 03:11 AM   #2
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 2,897
Default

Quote:
Originally Posted by NextLevel View Post
Hey Guys,

Anyone know of a way to export a list of all SWS/S&M extension, and custom action/script command IDs? I know how to return an ID via NamedCommandLookup(), however I need a solution to return them all to a text file with each command and it's current ID on a sperate line.
Something like this:

[COMMANDS]
_S&M_TGL_LOOPMEDIA_SELTRACK1=55490
_744689a4a22f1b429c4d7809469d3d16=55853
...etc.


Thank you
Search for 'dump action list' in actions list. There are 3 useful SWS extension actions - one of those will do this.
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine | LBX Floating FX Positioner | LBX SRD Smart Knobs
Donate via Paypal
lb0 is online now   Reply With Quote
Old 02-11-2017, 07:10 AM   #3
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 410
Default

Thanks, but not quite what I'm after.
I mean those files could be useful, but what I need is a script that can parse those files and return just the Command ID and it's temporary assigned number by using NamedCommandLookup() and format it into a text file like in my example from first post.

The reason I need it formated like that is because I then use autohotkey to run scripts that do a lookup of the Command ID and retutns the temp number into a variable so I can then execute custome & SWS actions via AHK, as REAPER only recognizes the command number (not it's static ID) coming into it from AHK.

I hope that made sense?
NextLevel is offline   Reply With Quote
Old 02-11-2017, 08:32 AM   #4
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 2,897
Default

Quote:
Originally Posted by NextLevel View Post
Thanks, but not quite what I'm after.
I mean those files could be useful, but what I need is a script that can parse those files and return just the Command ID and it's temporary assigned number by using NamedCommandLookup() and format it into a text file like in my example from first post.

The reason I need it formated like that is because I then use autohotkey to run scripts that do a lookup of the Command ID and retutns the temp number into a variable so I can then execute custome & SWS actions via AHK, as REAPER only recognizes the command number (not it's static ID) coming into it from AHK.

I hope that made sense?
Well this is the code in Stripper which loads the data from those action dump files - it fills a table action_tbl with the ID and description:

It may not work on its own - but the code is there... (Look in stripper code at function LoadActionIDs() )


Code:
    local sd = reaper.EnumerateSubdirectories(resource_path, j)
    while sd ~= nil do

      if sd == 'actiondumps' then
        local df = reaper.EnumerateFiles(actiondump_path,i)
        while df ~= nil do
          
          kb_table = {}
          filename = actiondump_path..'/'..df
          file = io.open(filename, "r")
          content = file:read("*all")
          for line in io.lines(filename) do table.insert(kb_table, line) end
          file:close()
    
          for i = 3, #kb_table do
            local actid, actnm = string.match(kb_table[i],'.-(%d+).-(%w.*)')
            if actid and actnm then
              actcnt = actcnt + 1
              action_tbl[actcnt] = {dcommand_id = actid, command_desc = actnm}
            end
          end
          i=i+1
          df = reaper.EnumerateFiles(actiondump_path,i)
        end
        break
      end
      j=j+1
      sd = reaper.EnumerateSubdirectories(resource_path, j)
    end
EDIT: I'm not sure whether this provides the information you need - but it's what I'm using - I don't use AHK.
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine | LBX Floating FX Positioner | LBX SRD Smart Knobs
Donate via Paypal
lb0 is online now   Reply With Quote
Old 02-11-2017, 09:06 AM   #5
NextLevel
Human being with feelings
 
Join Date: Dec 2014
Posts: 410
Default

Thank you, I'll have a look and see what I can glean from that.

Cheers
NextLevel 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 06:55 AM.


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