Configurable Tags

Love Hook has a tag attach to files.

Could the tag be configurable so it it could fit into a Omnifocus and macOS tag structure?

1 Like

Hook’s Link to New OmniFocus integration script could be updated to add whatever tag one wanted to use. Someone on Hook’s forum added that for Things. Doing something more general on our side has been on our minds and in our docs. Making the Hook tag configurable also makes sense to us.

1 Like

I’d really love to see that - definitely also for Omnifocus. I have a - some would say complicated - tag organisation that is mirror of my macOS tag’s for reference library.

1 Like

Here’s a script for Hook to New that adds a “Hook” tag to OmniFocus if OmniFocus does not yet have it, and the script adds the tag to the new task. You could rename the tag to something else.

If you want to try the script:

  1. open Hook’s preferences;
  2. click on the Scripts tab;
  3. select the correct OmniFocus 3 entry in the tab on left based on your copy of OmniFocus (i.e., app store vs. OmniGroup store) ;
  4. click on Link to New tab
  5. paste the script below into it;
  6. click the save button (bottom right).

If you want to revert to the built in script, just select the OmniFocus button on bottom left and click the “-” button. See also Scripts Tab – Hook.

caveat emptor. I’m not one of our script authors and they have not vetted this. Works in my limited tests on OmniFocus3 from OmniGroup store, which I use. Not extensively tested. Only designed for Link to New, not for adding and removing links. We should provide one of them too. Also, of course, this is just another small step towards tagging in Hook.

tell application "OmniFocus"
	activate	
	tell first document
		-- remove extraneous text from URL
		set AppleScript's text item delimiters to {"$$$"}
		set srcURL to text item 1 of "$link"
		
		-- Create a new task and note
		set myTask to make new inbox task with properties {name:"$title", note:"$title"}
		
		try
			set taskTag to (first flattened tag where its name is "Hook")
		on error
			set taskTag to make new tag with properties {name:"Hook"}
		end try

		add taskTag to tags of myTask
		
		-- hyperlink-ify the note
		set value of attribute named "link" of style of paragraph 1 of note of myTask to srcURL
		
		set taskID to "omnifocus:///task/" & (id of myTask)
		
		-- open task
		GetURL taskID
		
		-- return URL of task for Hook to link with source item
		get taskID
	end tell
end tell
1 Like

Many thank’s Luc,

I will work and test this.

-mic