is it possible to create new button or menu item of application using AppleScript as following if it possible , how it can achieve?
Asked
Active
Viewed 175 times
1
-
1Not with AppleScript, but it's certainly possible with ApplescriptObjC which is able to use the Cocoa frameworks – vadian Mar 08 '16 at 09:41
-
anybody know some sample code ? – DevÁsith Mar 08 '16 at 10:47
-
You may want to take a look at using Keyboard Maestro. It is a great automation tool that can be triggered by many events, including hotkey, found image on screen, menu, etc. Once triggered, then it can call an AppleScript, JXA, Shell Script, etc. – JMichaelTX Mar 08 '16 at 19:53
-
@JMichaelTX There is no way to add a new button to a target application using UI Browser and UI Actions and these products take the target application's user interface as they find it. They can monitor or read values of existing user interface elements such as buttons, and they can control existing user interface elements by, for example, clicking a button. But they cannot create new user interface elements in the target application – DevÁsith Mar 21 '16 at 06:25
-
@InfoAsith: I understand. I just thought that if you can't find a solution that actually modifies the UI of your app, that KM might provide you with a decent workaround. Good luck. – JMichaelTX Mar 21 '16 at 18:33
1 Answers
2
The answer, and I'm not kidding, is "it depends." What you can do in a scriptable application depends totally on what features the app developer has implemented. If they added a command to add a button to their UI, then you just execute that command and give it the data it needs, including (probably) an AppleScript to execute when that button is clicked. If the developer did not add such support, you're out of luck.
The bad news is that I haven't seen many apps that do such a thing.

Ron Reuter
- 1,287
- 1
- 8
- 14