Applescript, Windows 10, Parallels 14, and modifier keys
Thread poster: Lennart Luhtaru
Lennart Luhtaru
Lennart Luhtaru  Identity Verified
United States
Member
English to Estonian
+ ...
Jun 9, 2019

For whatever reason parallels doesn't seem to send any modifier keys to windows when I use applescript. I've tried the following ways to create "š" into notepad but all will produce "s" instead of "š" (alt/option + s). What am I doing wrong? The script works perfect inside MacOS but modifier keys seem to get ignored by parallels. The results are the same when I try to use shift instead to create "S" not "s". The point to making it work is to then create applescripts for elgato stream deck (or ... See more
For whatever reason parallels doesn't seem to send any modifier keys to windows when I use applescript. I've tried the following ways to create "š" into notepad but all will produce "s" instead of "š" (alt/option + s). What am I doing wrong? The script works perfect inside MacOS but modifier keys seem to get ignored by parallels. The results are the same when I try to use shift instead to create "S" not "s". The point to making it work is to then create applescripts for elgato stream deck (or any similar launcher) for weird symbols like μ or × and have them work in both MacOS and Windows applications. Anyone have any ideas?
---------
tell application "System Events"
key down option
key code 1
key up option
end tell
---------
tell application "System Events"
keystroke "š"
end tell
---------
tell application "System Events"
key code 1 using option down
end tell
--------
Collapse


 
Hans Lenting
Hans Lenting
Netherlands
Member (2006)
German to Dutch
Doesn't work for me Jun 9, 2019

I cannot get your script to work on my Mac with the U.S. International PC keyboard layout.

While looking at your script, I was wondering whether it wouldn't be a better idea to insert the character you need via the system clipboard. No hassle with modifier key states.

Personally, I use https://www.ergonis.com/products/popcharx/ both for Windows and macOS.


 
Lennart Luhtaru
Lennart Luhtaru  Identity Verified
United States
Member
English to Estonian
+ ...
TOPIC STARTER
Shift Jun 9, 2019

Try using shift instead of option. That should work even with US layout and type capital S. If I can get applescript to work, I can just configure https://www.elgato.com/en/gaming/stream-deck or any other similar LCD keypads trigger applescripts and don't have to deal with clipboard or remembering ALT+codes or key combinations.

 
Lennart Luhtaru
Lennart Luhtaru  Identity Verified
United States
Member
English to Estonian
+ ...
TOPIC STARTER
I just avoided modifier keys now Jun 11, 2019

I decided I don't have time to troubleshoot Parallels and applescripts for the modifier key problem any more. If it starts working in the future, all the power to them but for now I had to create triple the amount of scripts (one for memoq one for studio and one normal for MacOS). Applescript just uses clipboard + menu options instead now and I can just create shortcuts in stream deck configurator to switch profiles quickly.

So the no modifier keys solution is something like this:... See more
I decided I don't have time to troubleshoot Parallels and applescripts for the modifier key problem any more. If it starts working in the future, all the power to them but for now I had to create triple the amount of scripts (one for memoq one for studio and one normal for MacOS). Applescript just uses clipboard + menu options instead now and I can just create shortcuts in stream deck configurator to switch profiles quickly.

So the no modifier keys solution is something like this:
-----
tell application "System Events"
set the clipboard to "×"
tell application "System Events" to tell process "SDL Trados Studio 2019"
tell menu bar item "Edit" of menu bar 1
click menu item "Paste" of menu 1
end tell
end tell
end tell
-----

Pic of Stream Deck is attached. Every key can be reconfigured to whatever you feel like and I just save the bottom right key for profile switch. If someone has the same problem (uses a Mac and wants to use a reconfigurable LCD keypad with both Mac and Win apps) then feel free to let me know, I can explain what I did to make it work.

IMG_0492
IMG_0493
Collapse


 
Hans Lenting
Hans Lenting
Netherlands
Member (2006)
German to Dutch
Keyboard Maestro now supports Elgato Stream Deck Aug 14, 2019

Lennart Luhtaru wrote:

Try using shift instead of option. That should work even with US layout and type capital S. If I can get applescript to work, I can just configure https://www.elgato.com/en/gaming/stream-deck or any other similar LCD keypads trigger applescripts and don't have to deal with clipboard or remembering ALT+codes or key combinations.


I thought this could be of interest to you and other fans of Mac automation:

https://wiki.keyboardmaestro.com/manual/Whats_New


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Applescript, Windows 10, Parallels 14, and modifier keys






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »