QuickNote for Together (by Reinvented Software)

Sharing and discussing custom actions for LaunchBar
Post Reply
ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

QuickNote for Together (by Reinvented Software)

Post by ptujec » Mon Sep 07, 2009 4:58 pm

After checking Yojimbo I stumbled over Together http://reinventedsoftware.com/together/, which is kind of a „Yojimbo Pro“.
I like it much better, since its closer to Journler and also seems to be even better maintained.

The folks at Reinvented Software have been so kind to send me a version of my script for Together. I only had to add the property for the name of the new note.
Actually writing Quick Notes also works without this script. When you select the app and hit shift-space you can start typing. Return will bring up the so called „Shelf“. Depending on you settings you can chose a folder and add tags.
I still prefer the script because it gives me the option to set the name for the note.

Code: Select all

-- »QuickNote for Together« (http://reinventedsoftware.com/together/)
--
-- apdapted version »QuickNote for Yojimbo« by Ptujec
-- http://forums.obdev.at/viewtopic.php?p=10824&sid=6fddd19450a27d1d6a99cff45d129589#p10824
--
-- Thanks to the support @ Reinvented Software <support@reinventedsoftware.com>

on handle_string(theInput)
   
   tell me to activate
   
   set theInputName to truncateString(theInput, 20)
   set theName to text returned of (display dialog "Name:" default answer theInputName with title "QuickNote for Together")
   
   tell application "System Events"
      activate
      set restoreDelimiters to AppleScript's text item delimiters
      set AppleScript's text item delimiters to ","
      
      set theTags to "QuickNote, " & text returned of (display dialog "Tags:" default answer "QuickNote" with title "QuickNote for Together")
      
      tell application "Together"
         
         --   if exists note theName then
         --      
         --      tell application "LaunchBar"
         --         display in large type theName & " already exists" as text
         --      end tell
         --      
         --      tell application "Together"
         --         activate
         --      end tell
         --      
         --   else
         
         make new note with data theInput with properties {name:theName, tag names:theTags}
         
         --   end if
         
      end tell
      
      -- Important! See http://macscripter.net/viewtopic.php?id=24422
      set AppleScript's text item delimiters to restoreDelimiters
      
   end tell
   
   
end handle_string


---------------------------------------------------------
-- truncate code was written by @cometbus

on truncateString(inString, len)
   if length of inString < len then
      return inString
   else
      return text 1 thru len of inString & "..."
   end if
end truncateString

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: QuickNote for Together (by Reinvented Software)

Post by ptujec » Sun Oct 11, 2009 11:33 pm

Changed the script a bit. Now the order is 1) Name 2) Note 3) Tags

Code: Select all

-- »QuickNote for Together« (http://reinventedsoftware.com/together/)
--
-- apdapted version »QuickNote for Yojimbo« by Ptujec
-- http://forums.obdev.at/viewtopic.php?p=10824&sid=6fddd19450a27d1d6a99cff45d129589#p10824
--
-- Thanks to the support @ Reinvented Software <support@reinventedsoftware.com>

on handle_string(theInput)
   
   tell application "System Events"
      activate
      
      set theNote to text returned of (display dialog "Note:" default answer theInput with title "QuickNote for Together")
      
      set theTags to "QuickNote, " & text returned of (display dialog "Tags:" default answer "QuickNote" with title "QuickNote for Together")
      
      tell application "Together"
         make new note with data theNote with properties {name:theInput, tag names:theTags}
         
      end tell
   end tell
   
   -- tell me to activate
   -- display dialog "Show Note?" buttons {"Cancel", "Show"} default button 2 with title "QuickNote for Together"
   -- set userInput to the result
   -- if (button returned of userInput) is "Show" then
   --   tell application "System Events"
   --      activate
   --      set frontmost of process "Together" to true
   --   end tell
   -- end if
   
end handle_string

Post Reply