Re: Show Emoji & Symbols GUI access
Re: Show Emoji & Symbols GUI access
- Subject: Re: Show Emoji & Symbols GUI access
- From: Jim Underwood <email@hidden>
- Date: Mon, 6 Nov 2017 22:11:34 +0000
- Thread-topic: Show Emoji & Symbols GUI access
Yvan,
Please see my replies below.
Best Regards,
Jim Underwood
aka JMichaelTX
From: Yvan KOENIG <email@hidden<mailto:email@hidden>>
Date: Monday, November 6, 2017 at 3:43 AM
To: "ASUL (AppleScript)"
<email@hidden<mailto:email@hidden>>
Subject: Re: Show Emoji & Symbols GUI access
I hate code relying upon embedded strings which may be localized so I will
certainly not use your version.
I don't think I "hate" any code, but, as we all do, I do have my preferences. 😉
IAC, I did recognize the need for localization, so that's why I put the
relevant strings as properties, easily changeable:
________________________________
property validEmojiMenuNames : {"Emoji & Symbols", "Special Characters...",
"Emoji et Symboles"} -- name as appears in Edit menu property groupName :
"Favorites" -- Emoji Folder to be selected
________________________________
The issue is that that menu item of interest may not always be in the same
location. So, the user of the script will need to change either menu item name
(as in my script) OR, the menu item number (as in your script).
Either way, the script user may need to make a change.
I carefully inserted the instruction displaying the list of available menu
items showing thathere, the item dedicated to Emoji is the second one.
If it's the first one on your machine, edit the instruction
click menu item 2
as
click menu item 1.
The change required by the user of your script.
At first I wrote a version supposed to identify the correct item by itself:
tell application "System Events"
tell process "SystemUIServer"
set keyboardExtras to first item of (menu bar items of menu bar 1 whose value
of attribute"AXDescription" = "text input")
tell keyboardExtras
perform action "AXPress" # Reveal the menu items
tell menu 1
--name of menu items --> {"Afficher le visualiseur de clavier", "Afficher les
Emoji et symboles", missing value, "Ouvrir les préférences Clavier…"}
click (first menu item whose name contains "Emoji")
end tell # menu 1
end tell
end tell
end tell
This script works, but as I noted earlier, it has a ~5 sec delay after the
"tell menu 1" command.
This delay makes your script unusable for me.
My script does not have this delay.
I'm running Script Debugger 6.0.5 (6A205) on macOS 10.11.6
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden