Invert colors using Apple Script Editor?

I have been working with Apple's code writing application, "AppleScript Editor", to make fun stuff on my MacBook Pro. so one day I got an idea to prank my friends by creating a fake virus, I wanted to make the app but the only thing that is preventing me from it is Inverting colors using AppleScript. I have tried going to youtube or seeing the answer to the question. mostly everyone showed is how to invert colors or other applescript or the script for another scripting program. I have tried the script from other scripting apps and putting it to the applescript editor but it didn't do anything or it won't recognize it. can someone help me.

MacBook Pro

Posted on Oct 27, 2018 9:38 AM

Reply

Similar questions

2 replies

Nov 1, 2018 4:22 AM in response to Chris12_60

Try this:


tell application "System Events"

key code 28 using {command down, option down, control down}

end tell


The normal invert colours key combination of command-option-control-8 only works if you use the "8" key on the main part of the keyboard. It will not work with the "8" key on the numeric keypad. Each key, when pressed, sends a unique key code to the operating system. That's how the computer knows which key was pressed. So, if you used keystroke "8" using (command down, option down, control down) you would not get the desired result. This command needs to refer to the specific key pressed rather than to the character that results when you press a key. There are two "8" keys on a keyboard which includes the numeric keypad, but they have different key codes. Key code 28 is for the "8" key on the main part of the keyboard. Some commands will work with either of these two ways of simulating keystrokes, some will only work with one.

I hope this all makes sense.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Invert colors using Apple Script Editor?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.