Globally change target application?

Is it possible to change all macro references to a certain application to a different version of that application?

All our current macros reference “Adobe Illustrator CC 2015.3” and we will soon be moving to “Adobe Illustrator CC 2018”. Most macros will be compatible with either version (especially those using the “Open Document” action), but changing the target app could be very tedious.

This is the macro I was concerned about (about 50 "Open with" actons). I realized after posting my question that I should convert the Illustrator file name to a variable and create one "Open with" action after the "Switch" action.

Just learning.

There is no direct way in Keyboard Maestro.

The only way would be to export the XML and manually change it and then re-import it (or you can also do that via AppleScript but for a one off, it is probably easier to do in BBEdit).

Actually, I think this would be fairly easy to do using AppleScript to read and change the XML of each "Open with" Action.

For example, here is the XML of one such action:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Application</key>
  <dict>
    <key>BundleIdentifier</key>
    <string>com.latenightsw.ScriptDebugger7</string>
    <key>Name</key>
    <string>Script Debugger 7</string>
    <key>NewFile</key>
    <string>/Applications/Script Debugger 7.app</string>
  </dict>
  <key>IsDefaultApplication</key>
  <false/>
  <key>MacroActionType</key>
  <string>Open1File</string>
  <key>Path</key>
  <string>/Users/Shared/Dropbox/SW/DEV/KM/Test/@JMichaelTx's Speed of JavaScript Execution Test for Safari &amp; Chrome.scptd</string>
</dict>
</plist>

You can see that you would need to change only a few <string> values to change the application.

I have a test script that will loop through all Actions in a Macro. When I get a few minutes I'll take a look at doing this.

1 Like