The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Micro.blog
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
August 18, 2006
(This post is from my old, old, super old site. My views have changed over the years, hopefully my writing has improved, and there is now more than a handful of folks reading my site. Enjoy.)

I tend to hate AppleScript because... well, it tends to hate me. But I seemed to be able to get along with it this evening anyway.

I had a little problem where I wanted to open a bunch of links in new tabs in Safari, about 24 of em in a row. I could click on each one, having to click 24 times.. but I'm a programmer and that just seems lame. What if there were 150? Or 300? That solution doesn't seem to scale very well. So what I did is tabbed up to the first link (you can tab around from link to link when you have universal access on, did you know that?) and then whipped up this quick script:

delay 5 tell application "System Events"   repeat 24 times     keystroke return using command down     keystroke tab     delay 1   end repeat end tell

When I ran that in Script Editor, and I had 5 seconds to return to Safari, and 24 seconds later all my pages had opened up in new tabs.

Thank you AppleScript. This time. I still hate you, but just a little less.