![]() ![]() scpt file in a hidden folder in the user’s home folder: /Users/username/Library/Application Scripts/. ![]() For more information, see this Stack Overflow article. The MacScript function has been deprecated, therefore it is no longer supported (although at the time of writing it is still present in Office for Mac VBA). However, in the future we may have to use the more awkward AppleScript function. Scpt = scpt & "return current application's class ""NSEvent""'s modifierFlags()" scpt = "use framework ""AppKit""" & vbCrLf Multiple lines are separated by both return & linefeed characters. I posted a question “Is there a newer/better way to detect what modifier keys are being pressed?” at and got a very helpful reply from Nigel Garvey. “The company is advising its developers to use an alternative programming language instead, such as Python 3, which, however, does not come preinstalled on macOS.” Apple has officially deprecated Python 2.7 in macOS Monterey 12.3. My version is ScriptToRun = "do shell script ""/usr/bin/python -c 'import Cocoa print ()' "" "īUT in the latest MacOS upgrade, Monterey, Python is no longer built in. There used to be a workaround, posted by Ron de Bruin on which used the Cocoa library in Python to return the modifier keys pressed. But Excel for Apple Mac VBA does not detect the Command or Option (same as Alt) keys. For example, Application.OnKey “^%q”, “MyMacro” is launched by Ctrl+Alt+q. You know that feeling when a manufacturer pulls the rug from under you? When a feature (OK, a workaround, even a hack) you’ve been relying on for years suddenly stops working because of an “upgrade”? Welcome to the world of the VBA developer in an Apple environment.Įxcel VBA macros can be launched by keystroke shortcuts such as Ctrl+q, Ctrl+Shift+q, Ctrl+Alt+q. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |