View Single Post
Included copy from selection
HTML Code:
<code>


-- CREATES BOOKMARKS - USE IN CONJUNCTION WITH GotoBookMk.scpt


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


CreateBookMark()
on CreateBookMark()
-- New section --------------------------
	tell application "System Events"
		set cur_app to first process whose frontmost is true
		set x to (name of cur_app is "System Events")
		keystroke tab using command down
		repeat while (cur_app is frontmost)
			delay 0.2
		end repeat
		if x then
			set cur_app to first process whose frontmost is true
			keystroke tab using command down
			repeat while (cur_app is frontmost)
				delay 0.2
			end repeat
		end if
		keystroke "c" using command down
		delay 0.2
	end tell
	
	set my_sel to the clipboard
	set strMark to my_sel
	
	
	set myPath to "Macintosh HD:Alt mitt :Henrik:Kontor:To Do:To Do 2012:2012 Høst II.oo3:"
	
	tell application "Finder" to open myPath as alias

	tell application id "OOut"
		
		open myPath
-- end new section --------------------------
		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
			
			
			-- 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
-- Changed to beginning
				set rowBookMarks to make new row at beginning 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
		delay 0.2
	end tell
	return true
end CreateBookMark

-- Growl feedback 
-- New section --------------------------

property growlAppName : "Dan’s Scripts"
property allNotifications : {"General", "Error"}
property enabledNotifications : {"General", "Error"}
property iconApplication : "OmniFocus.app"

set my_sel2 to the clipboard
set strMark to my_sel2

tell application "GrowlHelperApp"
	notify with name "General" title "OmniConfirm" application name growlAppName description my_sel2
end tell
</code>