Keyboard Maestro “Execute an AppleScript” Action

Keyboard Maestro “Execute an AppleScript” Action

Execute an AppleScript.kmactions (0.7 KB)

This macro is not working. It will select Excel but it will not run the macro properly. This is because the Excel macro is supposed to select a certain sheet and it does not even do that. It will select Pycharm but when it hits cntrl F it will not go to the find box as it should. it will type hhh but not in the find box. My excel macro works and the apple script works when not used in keyboard maestro.

Update: the problem is with the applescript. I got it to work once but it’s not working anymore.

In order for us to help you, please post:

  • VBA macro
  • Example Excel file
  • The exact manual workflow you want to automate

Sometimes it's best to use a MS VBA macro, and sometimes it's best to automate the Office app (Excel in this case) entirely using AppleScript. It just depends on the workflow.

Archive.zip (376.2 KB)

Thanks for agreeing to help. As of right now, this is an applescript problem. I thought I got it to work once with applescript but it's not working now. What the macro does, is it turns an excel database into a python database. The Excel macro loops through an excel sheet and takes certain elements and rewrites them using Python syntax. Excel copies the python database and KM selects a specific spot in pyCharm, using control F, it inputs hhh in Pycharm and that should take one to the area on the Pycharm editor where the database belongs.

Also I tried a very simple code

The excel code is:
Sub hey_man()
InputBox (“str5”)
End Sub

And the Applescript code is:

tell application "Microsoft Excel"
activate
delay 2
run VB macro “hey_man”

end tell

Not working.