Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AppleScript

Status
Not open for further replies.

disord3r

Programmer
Apr 12, 2002
189
US
Is there a forum for AppleScripting that I'm not seeing, or would this be an appropriate place to post questions about AppleScripting?
 
There's not a specific forum here, so places like bbs.applescript.net and might be better. That's not to say that a post here would go unanswered...[smile]

soi la, soi carré
 
I guess it can't hurt to try...

I do a lot of website development, and making sure things work in all browsers is a very big deal. I wrote a .vbs on my PC that will prompt me for a URL and launch five different browsers to that url (to save me from doing it all manually). I'm trying to do the same thing on the Mac with an applescript, and Opera is not playing along. I was just wondering if anyone might know why.

Here's a code snippet (the tell...end tell is duplicated 4 more times for other browsers):

Code:
set s to text returned of (display dialog "URL:" default value "")

tell application "[i]application_name[/i]"
   OpenURL s
end tell

That will work for Firefox, Mozilla, and IE. Safari works too, but I had to use "set URL to s" instead of "openurl s". Neither of these, however, works with Opera. I have no idea what it's expecting.

If there's a better way to do this, I'm all ears. Thank you in advance.
 
Well, the first question you have to ask is...

"Does opera support applescript?"

In scripteditor, try to open Opera's applescript dictionary. If it doesn't have a dictionary, you can't use it.

If it *does* have a dictionary, read through it to see if you can find the command you need.
 
I'm very new to applescripting, so I wasn't even aware of the ability to view the dictionaries. I should find this very helpful.

Thanks, troll. :)
 
Well, I couldn't find a dictionary for Opera, but I played around with it a bit more and actually got it to work.

For reference, "open location s" is what did it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top