• 3 Posts
  • 225 Comments
Joined 2 years ago
cake
Cake day: June 11th, 2023

help-circle
  • Yeah, I have some Python scripts that reflow selected passages of code for me using this approach. It always feels so weird when I’m using some OS that seemingly doesn’t support any sort of GUI scripting.

    It’s worth noting that while you can simulate mouse clicks and key strokes within any app, some support a few direct scripting commands. For example, in Terminal, you don’t need a GUI script to open a new window and type in it to run some command. You can just issue an AppleScript command to tell app "Terminal" to do script "top" or whatever. That’s because Terminal’s scripting library includes a do script command.

    For more on this, you can fire up Script Editor and go Open Dictionary. You will see a list of all apps with any sort of scripting support and be able to get documentation on what you can do with it.










  • Your first one reminds me of something that happened awhile back. I was at a donut shop staring out the window when a scruffy dude in a pickup truck slammed into a traffic light, tipping it over across the street.

    Now as it happens, said donut shop was a watering hole for police officers (yes, the stereotype is real), and about a dozen buff uniforms trotted out within seconds. The guy climbed out of the truck and tried to light a cig and it fell out of his mouth as he saw them rushing up.