How can I get Automator to open a URL in the current Safari tab?

2

My current code involves a "Watch Me Do" block recording a W keystroke and then opening the new URL, but that's kind of kludgy. Is there any way I can use Automator to open a URL within the current tab? AppleScript would also be acceptable.

(Is this question too basic for Stack Overflow?)

timothymh

Posted 2012-01-25T23:03:21.847

Reputation: 143

Answers

2

tell application "Safari" to set the URL of the current tab of the front document to "whateverURLYouWant.com"

fireshadow52

Posted 2012-01-25T23:03:21.847

Reputation: 185

@nK0de If you're going to edit a post, please make sure that the edit is constructive. For example, please don't change the formatting of a poster's code so you can understand it. Most of the time, we know what we're doing and we wrote it the way we did for a specific reason. Just food for thought. :) – fireshadow52 – 2012-01-26T17:42:21.227

okay. I thought it was a mistake. sorry about that. – None – 2012-01-26T18:01:40.130

@nK0de It's all good. :) – fireshadow52 – 2012-01-26T18:12:21.923

1this showed up in the review list. That's why I thought it was wrong. anyway, its cool :) – None – 2012-01-26T18:16:14.087

That doesn't work for me. Also, the way you have it formatted makes it impossible to see all of the code; I had to copy and paste it. – timothymh – 2012-02-05T21:17:02.930

Though actually, nothing of that ilk is working, so I think it may me a bug having to do with my end of things. – timothymh – 2012-02-05T21:58:20.307