View Single Post
Code:
-- CREATES BOOKMARKS - USE IN CONJUNCTION WITH GotoBookMk.scpt

property pSection : "Bookmarks"
property pVer : ".01"
property pTitle : pSection & tab & pVer

CreateBookMark()

on CreateBookMark()
	tell application id "OOut"
		if (count of documents) < 1 then return
		-- GET THE ID OF THE FIRST SELECTED ROW
		tell front document
			set refSeln to a reference to selected rows
			if (count of refSeln) < 1 then return
			set strID to id of first item of refSeln
			
			-- GET A NAME FOR THE BOOKMARK
			activate
			set strMark to text returned of (display dialog pSection & " name:" default answer "" with title pTitle)
			
			-- FIND/CREATE A BOOKMARKS SECTION
			set refBookmarks to a reference to (rows where its level = 1 and its topic = pSection)
			if (count of refBookmarks) < 1 then
				set rowBookMarks to make new row at end of rows with properties {topic:pSection}
			else
				set rowBookMarks to last item of refBookmarks
			end if
			
			-- ADD A BOOKMARK (STORE ID IN NOTE)
			make new row at end of children of rowBookMarks with properties {topic:strMark, note:strID}
		end tell
	end tell
	return true
end CreateBookMark