Thread: AddingTags
View Single Post
This is the same script but now instead of pasting in to the clipboard you want to select the field that you want to paste this in to OmniFocus (yes I am lazy, so this helps.

Code:
-- Script To Populate OmniFocus Tags
-- Written by Yury German <yury (at) technologysecure.com>
-- Version: 1.01
-- Date of Change: 2013-07-10

set myDivider to {"__________________________________________"}
set myTags to {""}

-- This opens a file name 
-- I will have another script that will just open up a file location as it might be easier
set myNames to paragraphs of (read (choose file with prompt "Pick text file containing Tags"))
repeat with nextLine in myNames
	if length of nextLine is greater than 0 then
		set myTags to (myTags & nextLine)
	end if
end repeat

choose from list myTags with title "Tags" with prompt "Choose One or Multiple Tags" OK button name "Insert" with multiple selections allowed
set listchoice to result as text
set myText to (return & myDivider & return & return & "*** Tags: ***" & return & listchoice & return & myDivider & return)
set oldClipboard to the clipboard
set the clipboard to myText as text

tell application "OmniFocus"
	activate
end tell

tell application "System Events"
	keystroke "v" using {command down}
	delay 0.5
end tell
set the clipboard to oldClipboard