Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Safari Applescripts Fail

Safari Applescripts Fail
Thread Tools
rsh
Forum Regular
Join Date: Oct 2000
Location: Augusta, GA
Status: Offline
Reply With Quote
Jan 10, 2003, 06:05 AM
 
I can't get the "Side By Side" or "Fullscreen" applescripts for Safari to work. I've tried on more than one computer, and the scripts have never worked for me.

I either get an error message about "domain not found" for "hide dock" or I get an error that "no result was returned for some part of this expression."

Scouring the web, some folks appear to have the same problem. Others report the scripts working fine.

Any suggestions about what the hangup might be?
     
Professional Poster
Join Date: Mar 2002
Location: Boston
Status: Offline
Reply With Quote
Jan 10, 2003, 06:28 AM
 
Yeah, submit a bug report to apple and wait for the final release, it is in fact only a beta.

Mike
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Jan 10, 2003, 07:57 AM
 
What scripts?
     
rsh  (op)
Forum Regular
Join Date: Oct 2000
Location: Augusta, GA
Status: Offline
Reply With Quote
Jan 10, 2003, 09:12 AM
 
These scripts:

http://www.apple.com/applescript/safari/

As to the comment: "submit a bug, it's only beta" -- these scripts were provided by Apple, written FOR the Safari beta.

So doesn't it make sense that they should work?
     
wil
Mac Enthusiast
Join Date: Oct 2001
Location: Seattle
Status: Offline
Reply With Quote
Jan 10, 2003, 09:36 AM
 
I know that some of the scripts require the GUI Scripting (Beta Software) found here: http://www.apple.com/applescript/GUI/

But, I installed it as well and have the same problem as rsh.
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Jan 10, 2003, 09:54 AM
 
Thanks for the links.
     
Mac Elite
Join Date: May 2001
Location: NYC
Status: Offline
Reply With Quote
Jan 10, 2003, 10:07 AM
 
Same here.

On my machine, the "Full Screen" script seems to having trouble with the "count of windows" line, from System Events. No idea why.

edit: AppleScript 1.9.1, Script Editor 2.0 beta.
(Last edited by lookmark; Jan 10, 2003 at 10:15 AM. )
     
rsh  (op)
Forum Regular
Join Date: Oct 2000
Location: Augusta, GA
Status: Offline
Reply With Quote
Jan 10, 2003, 12:29 PM
 
Glad to know I'm not alone. But I have seen others report that the scripts work for them. I wonder what we are doing wrong?
     
Junior Member
Join Date: Oct 2001
Status: Offline
Reply With Quote
Jan 16, 2003, 08:47 PM
 
You have to have the GUI Scripting software installed and then go to the Universal Access Seeing tab and select "Enable access for assitive devices" Then it should work without a hitch.
     
Mac Elite
Join Date: May 2001
Location: NYC
Status: Offline
Reply With Quote
Jan 16, 2003, 09:50 PM
 
Originally posted by Britney F.:
You have to have the GUI Scripting software installed and then go to the Universal Access Seeing tab and select "Enable access for assitive devices" Then it should work without a hitch.
That's odd. They should point that out that on the Safari AppleScripts page.

The GUI Scripting software is still in beta, after all. Not a standard installation.
     
Sal
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status: Offline
Reply With Quote
Jan 17, 2003, 12:37 AM
 
Sorry about those problems. I'll make the edit to the page so that it clearly says to install UI Scripting.

However, here's a new routine you can use in the Side-by-Side script that does't depend on UI Scripting. Replace the existing sub-routine at the bottom of the script with this one:

on desktop_size()
set swidth to word 3 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Width")
set sheight to word 3 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Height")
return {(swidth as number), (sheight as number)}
end desktop_size
     
Sal
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status: Offline
Reply With Quote
Jan 17, 2003, 12:40 AM
 
Just an FYI but the release version of Safari will include a Do JavaScript command so that AppleScript scripts can execute JavaScript commands and process the results.

This will do much to expand what you can do with Safari and AppleScript.

What other scripting commands or properties would you like to see in future versions?

Sal Soghoian
AppleScript Product Manager
     
Fresh-Faced Recruit
Join Date: Jan 2003
Location: West London, England
Status: Offline
Reply With Quote
Jan 17, 2003, 05:08 AM
 
Originally posted by Sal:
Just an FYI but the release version of Safari will include a Do JavaScript command so that AppleScript scripts can execute JavaScript commands and process the results.
Great news Sal! This is one of the very few features I really miss in IE. I have a set of scripts set up that allow me a one click login to all of my Internet banking web pages - which is a lot easier and faster than than the manual way!

Other requests would include:
[list=1][*]the ability to retrieve the page source directly from Safari would nice.[*]Bookmark editing scripting commands would be useful - examining existing bookmarks (including looking within folders), creating new items, deleting old ones and so on.[*]Recordability?[/list=1]
     
Sal
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status: Offline
Reply With Quote
Jan 17, 2003, 10:41 AM
 
Originally posted by baggie:
Great news Sal! This is one of the very few features I really miss in IE. I have a set of scripts set up that allow me a one click login to all of my Internet banking web pages - which is a lot easier and faster than than the manual way!

Other requests would include:
[list=1][*]the ability to retrieve the page source directly from Safari would nice.[*]Bookmark editing scripting commands would be useful - examining existing bookmarks (including looking within folders), creating new items, deleting old ones and so on.[*]Recordability?[/list=1]
Thanks for the suggestions.

BTW, you can get the source and the text of a page with the current build of Safari. The script that scrubs the Reuters news site is an example of this.
     
Mac Elite
Join Date: May 2001
Location: NYC
Status: Offline
Reply With Quote
Jan 17, 2003, 11:31 AM
 
Originally posted by Sal:
Sorry about those problems. I'll make the edit to the page so that it clearly says to install UI Scripting.
Thanks Sal. I did notice, just after that post, the note about UI Scripting for the iPhoto script. It would definitely be more clear if that note referred to the whole page.
     
Junior Member
Join Date: Mar 2000
Location: St. Cloud, Florida
Status: Offline
Reply With Quote
Jan 17, 2003, 12:04 PM
 
Thanks for the help Sal!

(As an aside to everyone else, Sal has a book on AppleScript coming out later this year, called AppleScript 1-2-3. Amazon.com already has information posted about it.)

(No, I'm not related to Sal, just a fan of AppleScript.)

Sincerely,
Tom McKenna
(Last edited by McKenna; Jan 19, 2003 at 08:34 AM. )
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:02 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2