The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniWeb > OmniWeb General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Applescript and Bookmark Path Thread Tools Search this Thread Display Modes
Does anyone have an example on how to applescript a path to a nested bookmark. This script is from an earlier post by scb

tell application "OmniWeb"
tell favorites
set theaddress to address of bookmark "Quix"
end tell

tell front browser
OpenURL theaddress
end tell

end tell

This script also works using personal bookmarks in place of favorites.
How can I make it work if the bookmark "Quix" in another folder like:
Favorites/My Bookmarks/"Quix"
 
This is undoubtedly not the best way to do it, but it does give some idea of the structure.

I'm trying to get to the "How to Buy" bookmark which is in the "The Omni Group" folder in Personal Bookmarks. Bookmark folders are just bookmarks with more bookmarks within, so I grab the bookmarks from the top-level bookmark for the folder and walk the list looking for a matching name. Probably one wishing to do a lot of this would write a routine that takes a pathname, grabs its components in succession and walks the bookmark tree to the bottom. Left as an exercise for the reader :-)

Code:
tell application "OmniWeb"
	set _bookmarks to bookmarks of bookmark "The Omni Group" of personal bookmarks
	
	repeat with i from 1 to length of _bookmarks
		if name of item i of _bookmarks is "How to Buy" then
			set theaddress to address of item i of _bookmarks
			exit repeat
		end if
	end repeat
	
	tell front browser
		OpenURL theaddress
	end tell
end tell
 
I also found another way of doing the script
the key was finding out that the folder is a bookmark without an address
you can assign an address to the folder and it will open that address
it will also become a folder Icon with a bookmark Icon over it

tell application "OmniWeb"
tell personal bookmarks -- or favorites
tell bookmark "The Omni Group" -- folder
set theaddress to address of bookmark "Omni News"
end tell
end tell

tell front browser
OpenURL theaddress
end tell
end tell
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Critical Path - won't highlight path aboeing OmniPlan General 4 2014-04-09 12:49 PM
Getting the path of a project RobTrew OmniFocus Extras 2 2011-09-08 08:23 AM
AppleScript to open bookmark folder in Safari urtlnomis OmniFocus Extras 0 2011-04-05 09:12 AM
The Path to being an OG Ninja bump OmniGraffle General 1 2010-07-14 09:45 AM


All times are GMT -8. The time now is 01:58 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.