Safari 3 beta don't yet perfect

You now have tab class but its part of window class not document class. When only documents have tabs, with window you get download and others. Javascript has in tab. You can email contents. The show bookmarks command always create a new window. A pain. Here’s a little slideshow script of new features

tell application "Safari"
	activate
	tell window 1
		repeat with i from 1 to (count tabs)
			set current tab to tab i
			delay 2
		end repeat
		set ImageCount to do JavaScript "document.images.length" in last tab
		display dialog (ImageCount as string) giving up after 2
		show bookmarks
		delay 2
	end tell
	set index of window 2 to 1
	tell window 1
		email contents of middle tab
	end tell
end tell

New find feature not scriptable (maybe by GUI). It real cool, it fade the screen highlight the found items, and the current one is bright orange. Merge all windows feature, turn windows in to tabs. And a reserve move tabs to windows. (GUI script that). Resize text field work in THIS PAGE. Some what cool. Wonder how you would script than. Remove history items now in preferences. Gone are the days of UNIX plist setting.

Save document now save as a .html instead of .download An improvement but still doesn’t seem to save as .webarchive even throw there’s a ‘as’ option. (Still have to GUI script)

Any other note would be great. Maybe Apple will read this before final release. I’ll bug report the page.

Have fun.

Thank you very much for collecting all these informations, Bevan.

Personally I’ve tried and already removed Safari 3 beta, because I can’t live without Sogudi, which doesn’t work with the beta

This bug still there. Call the text in tell document you get nothing, but a of document you get the text of the page.

tell application "Safari"
	activate
	tell document 1
		set x to text --result is nothing
	end tell
	set y to text of document 1 --result is the text of the page
end tell

URL and all others work Ok in the tell document, just text.

It’s not a bug; AppleScript is reading text as the AppleScript class. You can explicitly reference the text property of the document by using its:

tell application "Safari"
	tell document 1
		set x to its text
	end tell
end tell

x

Didn’t think of ‘its’ or ‘of it’. Sometimes you need to point to it self. You are pointing to the object with tell statement, It should work. Like URL does. Not really a bug I guess.

Sogudi is interesting plugin. But you could write an Applescript to do the same thing. May be not quite type and return, a popup dialog on go. Or get url and go. UNIX Man and Javascript may be fun to get going in Applescript. Anyway the writer of Sogudi will likely update for Safari 3 release. I use TabExpose I wonder if that works.

Would be nice if you could script the google search, like setting a URL. (GUI again works or convert to URL)