samknight / slack_applescript

AppleScript bundle for Slack methods
275 stars 20 forks source link

[2.0.0-beta.2] shortcuts writing "=" on AZERTY keyboards #15

Open JeroenVdb opened 3 years ago

JeroenVdb commented 3 years ago

I know your still working on the rewrite but here is some input on something I'll probably miss when using a QWERTY keyboard.

When I run this code:

tell script "Slack"
    send message "this is an automated message" in channel "#testjeroen"
    clear status
    set as away
end tell

I get this on Slack:

this is an automated message
=Clear your status
=Set yourself as active

Screenshot: Screenshot 2020-11-15 at 16 21 17

When I switch my keyboard layout to QWERTY it works better BUT the messages are not send (enter).

Example screenshot:

Screenshot 2020-11-16 at 08 32 47
samknight commented 3 years ago

Hi,

My theory at the moment is that the delays in the code are too short. Could you add in a manual delay 0.5 or longer between each step and see that resolves it for now

JeroenVdb commented 3 years ago

You are right, this works (with QWERTY):

tell script "Slack"
    send message "this is an automated message" in channel "#testjeroen"
    delay 0.5
    set as away
end tell
samknight commented 3 years ago

Hi, I've updated the library with a slower process https://github.com/samknight/slack_applescript/releases/tag/2.0.0.rc1

fixcompain commented 3 years ago

Hi, did you correct it for AZERTY keyboard too ?

samknight commented 3 years ago

I've not been able to test it I'm afraid. Do you know what the theoretical issues could be between AZERTY and QWERTY in AppleScript?

fixcompain commented 3 years ago

I know that "key codes" are generated by keys according to their physical positions in the keyboard, so I can't really tell if there is a solution at the end May you use copy paste instead ?

linux2647 commented 3 years ago

I've noticed the same issue if I have Dvorak enabled. Instead of a /, a z is typed instead, as the keycode that emits a / in QWERTY emits a z in Dvorak.

samknight commented 3 years ago

I'm afraid this has been my only ever AppleScript project so this one has stumped me I'm afraid. I'll keep looking but I don't think I'll be managing to solve this one any time soon.

I'm reliant on a few key codes that I don't think I can replicate with keystroke.

I can replace key code 44 with "/" so that would help with potentially a couple of scripts

samknight commented 1 year ago

I have replace the key code with with the "/" in 2.0.3 - can you let me know if this solves the issue?