3 ms·
this is by far the worst programming language I've seen: else tell application "System Events" tell process "Safari"
by meiraleal 3y ago
this is by far the worst programming language I've seen:
else
tell application "System Events"
tell process "Safari"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
click menu item "Close Tab"
end tell
end tell
end tell
end tell
end tell
end if
end tell
- sitzkrieg 3y agoif this is the worst you have had a good time
- dewey 3y agoAnd yet, it's a very powerful language for automation and even if you never heard about AppleScript you still know exactly what it's going to do and might be able to write your own automation.
- yjftsjthsd-h 3y agoIt's meant to be usable by people with no programming experience or training, and it's meant to work. It does those two things better than something that looks pretty.
- nebula8804 3y agoCut them some slack its 30 years old but still pretty effective though.
- larkost 3y agoThis example is pretty bad AppleScript. A much better way of writing this exact behavior is: tell the first window of the application "Safari" close the first tab end tell Of course a real script would do things like make sure there is such a window, or be more specific than "the one on top", which is implicit in both these scripts. I am not enamored with AppleScript for a number of reasons, but this example is just bad, and does not really show any of the actual problems with AppleScript/
- krackers 3y agoI've long since thought that applescript might be the world's only _read only_ langauge. Turns out that C2 thought so too: https://wiki.c2.com/?ReadOnlyLanguage https://wiki.c2.com/?ReadOnlyLanguage