May you test the script from the Script Editor ?
Here I got:
Don't click upon [Open this Scriplet in your Editor:] this is a log history
tell application "System Events"
get application process 1 whose frontmost = true
--> application process "Script Editor"
get name of application process "Script Editor"
--> "Script Editor"
get has scripting terminology of application process "Script Editor"
--> true
get path of file of application process "Script Editor"
--> "SSD 1000:Applications:Utilities:Script Editor.app:"
get name of every menu item of menu 1 of menu bar item 9 of menu bar 1 of process "Script Editor"
--> {"Placer dans le Dock", "Placer toutes les fenêtres dans le Dock", "Réduire/agrandir", "Réduire/agrandir toutes les fenêtres", missing value, "Afficher l’onglet précédent", "Afficher l’onglet suivant", "Placer l’onglet dans une nouvelle fenêtre", "Fusionner toutes les fenêtres", missing value, "Tout ramener au premier plan", "Mettre au premier plan", missing value, "Historique", "Bibliothèque", missing value, "Enregistrer comme réglage par défaut", missing value, "Sans titre", "Sans titre 2", "Sans titre 3", "Sans titre 4", "search in lProjs.scpt", "set windows settings.applescript"}
end tell
tell application "Script Editor"
open file "SSD 1000:Applications:Utilities:Script Editor.app:"
--> missing value
end tell
tell current application
activate
end tell
As you see, they were not “Script Editor.sdef” window open so the script opened the file.
Don't click upon [Open this Scriplet in your Editor:] this is a log history
tell application "System Events"
get application process 1 whose frontmost = true
--> application process "Script Editor"
get name of application process "Script Editor"
--> "Script Editor"
get has scripting terminology of application process "Script Editor"
--> true
get path of file of application process "Script Editor"
--> "SSD 1000:Applications:Utilities:Script Editor.app:"
get name of every menu item of menu 1 of menu bar item 9 of menu bar 1 of process "Script Editor"
--> {"Placer dans le Dock", "Placer toutes les fenêtres dans le Dock", "Réduire/agrandir", "Réduire/agrandir toutes les fenêtres", missing value, "Afficher l’onglet précédent", "Afficher l’onglet suivant", "Placer l’onglet dans une nouvelle fenêtre", "Fusionner toutes les fenêtres", missing value, missing value, "Tout ramener au premier plan", "Mettre au premier plan", missing value, "Historique", "Bibliothèque", missing value, "Enregistrer comme réglage par défaut", missing value, "Sans titre", "Sans titre 2", "Sans titre 3", "Sans titre 4", "Script Editor.sdef", "search in lProjs.scpt", "set windows settings.applescript"}
click menu item "Script Editor.sdef" of menu 1 of menu bar item 9 of menu bar 1 of process "Script Editor"
--> menu item "Script Editor.sdef" of menu "Fenêtre" of menu bar item "Fenêtre" of menu bar 1 of application process "Script Editor"
end tell
This time,
As you see, a window “Script Editor.sdef” was available so the script just click the menu item bringing the window at front.
Of course, if the dictionary of a given application doesn’t appear in a xx.sdef window the scheme will not apply.
If you meet such case, it would be fine to post the name of the window displaying the dictionary.
It would be quite easy to enhance the script accordingly.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 12 janvier 2020 10:57:48