Hello, everyone! As this is my first post here, I’d like to greet the MacScripter community first of all.
I have little knowledge of programming languages and I’m now dabbling for the first time with Applescript and Automator, which I’ve been greatly enjoying. I’m currently writing a simple workflow to automate the process of switching my KVM to a different HDMI input by controlling an RM Mini infrared device with my Mac. I’ve succeeded in doing this through Terminal, by using an application called Python Broadlink and using the following command, specific to the application:
However, when using either the Automator or the Script Editor applications, I can’t get it to work. I’ve spent hours double checking and triple checking all sorts of combinations, and they either won’t recognise the application or find the file passed as an argument (KVM.PC).
First of all, show us your Terminal’s prompt. please. This, for example, is prompt of zsh shell on my Terminal:
123@MacBookPro ~ %
your executable is not part of Broadlink application, but independent executable. So it should be somewhere here : /usr/bin/, /usr/sbin/, /usr/local/bin/ or /usr/local/sbin. To find were it is, execute script:
Thank you for your assistance. Here’s the prompt on my Terminal’s zsh shell: Realinho@Realinhos-iMac ~ %
Running your script in Automator or Script Editor gives me the following error: “The command exited with a non-zero status.” number 1
I tried “which broadlink_cli” in Terminal and got “broadlink_cli not found”
Checking all of the folders that you mentioned I realised that there are a bunch of aliases to all sorts of executables, but indeed, none related to broadlink_cli. Was it wrong to install it in my user folder? That would be: /Users/Realinho/python-broadlink/cli/broadlink_cli
KniazidisR, I created an alias of the broadlink_cli executable, renamed it to “broadlink_cli” and moved it to /usr/local/bin/. Sadly, when trying do shell script “which broadlink_cli”, I’m still getting a “The command exited with a non-zero status.” error and under Automator’s Run AppleScript log a “/usr/local/bin/broadlink_cli: Permission denied” message.
Thank you for the Posix tip, as I was ignorant of this. Just researched it and now understand the difference. The corrected target file’s path seems about right.