@eurobubba, I am able to find the app ID of an app, and subsequently open the apple menu bar app's menu.
@kraftyDevil, Is your question still current? I use Tyme 2 with Bartender 2
and have created me a KM macro selection. Here in the video you can see the process.
I created a macro which is basically simple:
user input→ variable (app name) → clipboard → shell script to find the app's app ID.
I am looking for a way to pass the app name to the shell script
thanks in advance for your time and help
I think you need to use KMVAR
###? How Do I Get KM Variable in Shell Script from other Apps?
I need to get the value of a KM variable using shell scripts from other apps.
This works in KM:
but NOT in any other app.
I understand why this does not work in apps like Terminal (see below).
But is there a way to make the KM environment available to other apps, so I can get the KM variable?
BTW, I have searched extensively in the KM wiki, forum, and general google, but could not find an answer to this question.
thank you for the suggestion.
I am a bit frustrated because I basically just want a macro to click on a menu bar app icon.
@Tom's macro is excellent and I am grateful, but for many apps (KBM, Copy'emPaste, etc) once I get the Bundle ID and run the macro below you can only see those apps where clicking on the menu bar item is considered the equivalent of 'Show Menu'. For many apps. what you see when you click on the menu bar icon is not considered a 'menu'.
I cannot click by position because the location of the menu bar items changes.
Would you have any idea how to create the equivalent of clicking on the apple menu item?
thank you !
@ronald, there are several factors to consider when using AppleScript.
The app you want to access must be able to use AppleScript!
At the place with the red arrow you always have to try if the app reacts to "1" or like here "2".
If you want to open the app and control it manually (arrow key), leave out the lower part of the script
If you have changing menu commands, you can replace "key code" in the script with the command "keystroke" and use the menu command "Cancel" as in my example. You have to pay attention to the correct spelling:
thank you. I am still confused.
1- how do I watch your video ? it goes too fast and I have no pause or speed control
2- where does the script you show come from?
the script I was discussing was simply (for default folder X)
tell application id "com.stclairsoft.DefaultFolderX5"
@ronald, I misunderstood and thought you already work with the AppleScript shown above.
The script is from
@tom, unfortunately I can't find the post for it. Just an older post from me:
Here is the UI Script
Menubar Item Action.kmmacros (1,9 KB)
Since the apps in the Menubar can be addressed differently, you must either
tell menu bar 1
tell menu bar 2
for the UI Script try out
In my example Yoink is entered as Application. Please change this to your Program/App
The thanks go to @tom who had made a post for it, which I unfortunately can't find on the fast one.
I do not use Default Folder. Maybe someone else can help you there.
How can I watch your videos slowly ? I am getting dizzy. thank you
if you open a GIF in Preview, you can see it frame-by-frame