1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-05 15:09:08 +02:00
audacity/scripts/piped-work/get-gui-structure.py
James Crook 27d2b7c51b Add AutomationCommands class
- AutomationCommands replaces GetAllMenuCommands, and can provide
information about menus, buttons and toolbars to a script.
- BatchCommands can now return textual results to a script.
- There's a new GUID for mod-script-pipe and it is included in the .sln.
2018-01-06 19:27:45 +00:00

39 lines
827 B
Python

# get-gui-structure.py
# Obtains all menus and all box locations from the currently running Audacity.
toname = '\\\\.\\pipe\\ToSrvPipe'
fromname = '\\\\.\\pipe\\FromSrvPipe'
tofile = open( toname, 'wt' )
fromfile = open( fromname, 'rt')
def sendCommand( command ) :
print( "Send: "+command )
tofile.write( command + '\r\n\0' )
tofile.flush()
def getResponse() :
result = ''
line = ''
while line != '\n' :
result += line
line = fromfile.readline()
return result
def doCommand( command ) :
sendCommand( command )
response = getResponse()
print( "Rcvd: " + response )
return response
def do( command ) :
doCommand( command )
def getStructure() :
do( 'GetBoxes' )
#doCommand( 'Screenshot: CaptureMode=menus' )
do( 'GetMenusPlus' )
getStructure()