Comments

1 comment

  • ericnepean
    if you run this Applescript, it will copy the contents of Behringer X Touch.xml on your desktop to Behringer X Touch.plist


    use AppleScript version "2.4" -- Yosemite (10.10) or later
    use scripting additions
    set posix2PrefFile to (get POSIX path of (path to desktop)) & "Behringer X Touch.plist"
    set theXMLFile to (get POSIX path of (path to desktop)) & "Behringer X Touch.xml"

    set commandList to {}
    tell application "System Events"
    tell XML file theXMLFile
    tell XML element "Commands"
    repeat with commandCtr from 1 to (count of every XML element)
    tell XML element commandCtr
    set commandList to commandList & {{commandName:(get value of XML attribute "CommandName"), commandShortCut:(get value of XML attribute "CommandShortcut")}}
    end tell
    end repeat
    end tell
    end tell
    end tell

    tell application "System Events" -- make a new prefs file
    set the parent_dictionary to make new property list item with properties {kind:record} -- create an empty property list dictionary item
    set theFile to make new property list file with properties {contents:parent_dictionary, name:posix2PrefFile} -- create new property list file using the empty dictionary list item as contents
    tell theFile to make new property list item at end with properties {kind:record, name:"Commands", value:commandList}
    end tell


    It will create a plist file whose listing starts like this (it's quite long)

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Commands</key>
    <array>
    <dict>
    <key>commandName</key>
    <string>CreateCatalog</string>
    <key>commandShortCut</key>
    <string>196686</string>
    </dict>
    <dict>
    <key>commandName</key>
    <string>CreateSession</string>
    <key>commandShortCut</key>
    <string>131150</string>
    </dict>
    <dict>
    <key>commandName</key>
    <string>OpenSession</string>
    <key>commandShortCut</key>
    <string>131151</string>
    </dict>


    This listing was generated by this command in Terminal
    cat /Users/ev/Desktop/Behringer\ X\ Touch.plist
    0
    Comment actions Permalink

Please sign in to leave a comment.