Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fharper/applescripts
Apple Scripts I created
https://github.com/fharper/applescripts
Last synced: 24 days ago
JSON representation
Apple Scripts I created
- Host: GitHub
- URL: https://github.com/fharper/applescripts
- Owner: fharper
- License: unlicense
- Created: 2023-08-17T21:17:59.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-30T20:53:38.000Z (6 months ago)
- Last Synced: 2024-05-02T10:21:23.727Z (6 months ago)
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AppleScripts
Here's are some Apple Scripts I created. Use at your own risks.
Feel free to suggest any improvements as I'm not expert, or add other useful ones.
- [Fake Typing](#fake-typing)
- [Get System Settings Panes IDs](#get-system-settings-panes-ids)
- [Notifications grouping off](scripts/notifications-grouping-off.scpt)## Fake Typing
Useful when you want to create a demo video, and ensure there's no typo.
```applescript
set command to "ls -lsa"tell application "iTerm" to activate # Remove or change
delay 2 # So you can move the mouse away or anything else
repeat with i from 1 to count of characters in command
set letter to character i of command
tell application "System Events" to keystroke letter
delay (random number from 0.025 to 0.075)
end repeattell application "System Events" to keystroke return
```[Compiled version](scripts/fake-typing.scpt).
## Get System Settings Panes IDs
Use it to find the ID of a specific panel on the left menu of System Settings so you can easily automate it in a script.
```applescript
tell application "System Settings"
activatedelay 0.5
set the current pane to pane id "com.apple.Notifications-Settings.extension"tell every pane
its id
end tell
end tell
```[Compiled version](scripts/get-system-settings-panes-ids.scpt).
## Notifications grouping off
Useful to automatically set the notifications grouping setting to off for a specific application.
```applescript
set appName to "Google Chrome" # set to the app name displayed in the Notifications application list
set delayTime to 0.5tell application "System Settings"
activate
delay delayTime
#my delayUntilApp("System Settings")set the current pane to pane id "com.apple.Notifications-Settings.extension"
delay delayTime
#my delayUntilWindow("Notifications")#do shell script "open x-apple.systempreferences:com.apple.Notifications-Settings.extension"
#delay delayTimetell application "System Events"
tell front window of (first application process whose frontmost is true)delay delayTime
set theButton to (first button of group 2 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 whose value of attribute "AXAttributedDescription" contains appName)click theButton
delay delayTimeclick pop up button 2 of group 4 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1
delay delayTimepick menu item "Off" of menu 1 of pop up button 2 of group 4 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1
delay delayTimeclick button 1
end tell
end tellend tell
```[Compiled version](scripts/notifications-grouping-off.scpt).