I would like to write a script that helps someone to write a menu item’s correct position, e.g. for a blog post. The idea is relatively simple. I would either display a search box where one could enter the menu item’s name, and then use the script to search for it, or display a menu with menus, then a list of menu items, then a list of sub-menu items, then the user can click OK and the correct path to the menu item is inserted.
Let’s assume I would like to tell someone how to find the Superscript option in TextEdit. The script would allow to search for “superscript” and then insert something like: “Format â†’ Font â†’ Baseline â†’ Superscript”.
In another example, where one doesn’t know the correct menu items’ name:
They would execute the script, which would then display:
Then the user could click Format, which would then display the contents of the Format menu, then the contents of the Font menu, etc.
I hope this all makes sense. I know how to get the name of every menu item, but I can’t figure out how to keep the hierarchy intact.
A lot of that is in the Help menu. The Help menu might give you ideas. Although, I don’t see many movies. You could make a movie that shows the cursor moving to the right menus. Or create pictures with Preview using bubbles. A picture is worth a thousand words. Your last idea could use a ‘choose from list’ dialog searching for the items using ui element scripting. In the past, Apple had an easy way to create your own help movies. Don’t know if it is still there.
It sounds interesting though, although it sounds like a lot of work. It might help to know what you know. Right now I’m trying to finish up on something.
No movie. This is not supposed to be a replacement for documentation or anything. Just a script to let one choose a menu item and insert its path. As in my example. Choose Superscript for TextEdit and insert the text “Format â†’ Font â†’ Baseline â†’ Superscript”.
Actually, I think this doesn’t make sense. If the user doesn’t know the name, then how can the computer know what the user is looking for. The computer can only do what you tell it to. It can’t read your mind. I don’t understand.
Edited: the only thing you can program into the computer is make a whole list of all the user’s options. Then the user can choose from that list.
Edited: one option might be that if the user enters something, then the computer can find something that sounds like it. In unix, it might be something like ‘apropos’. In an internet search field, they list things that might sound like something the user has entered. Note that with AppleScript, this might take a very long time.