Page 1 of 2

Substitute text :: Frequently used email responses

Posted: Thu Dec 11, 2008 9:41 am
by jka33331
PC has an application called Active Words and I used to use this app to respond to repetitive emails that I would issue the same response with a hot key - copy/paste functionality. e.g. I would hit Command TY and I would have a auto response named Thank You that would be pasted into the message. This "Thank You" file would be a few paragraphs paragraphs of previously written text.

Is this feature available on launch bar and if so, how exactly would I do that. Any help would be greatly appreciated. :)

Posted: Thu Dec 11, 2008 9:43 pm
by Dennis
Well, there are a couple ways you could do this:

  1. Use LaunchBar's Text Clips feature. From LaunchBar help:

    A text document whose filename ends with a special .clip.txt or .clip.rtf filename extension is treated as a Text Clip File. Opening such a file via LaunchBar inserts the file’s contents in the frontmost application.

    You can use this feature to quickly insert predefined text blocks in the currently edited document.

  2. Similar to Text Clips, you can use LaunchBar to copy and paste the contents of any text, RTF, PDF, HTML, or image file in a single keystroke by simple selecting the file in LaunchBar and hitting Command-Option-Shift-C.The contents of the file will be pasted at the cursor point of the frontmost app.

    Strangely, this command used to appear in LaunchBar 4's menus but doesn't in the LaunchBar 5 beta 1. But the keyboard shortcut still works. Hopefully, this is only an oversight in the new beta.
  3. Use an app like TextExpander that allows you to define a variety of snippets that will automatically be expanded when you type a specific series of characters in any app. For example, I have a snippet that expands to "LaunchBar" whenever I type "llb".

    Once nice advantage TextExpander has over LaunchBar's Text Clips is that TextExpander allows you to have dynamic content in your snippets. For example, you can have placeholders that expand to a date, or pull in the content of another snippet, or insert the output of a script.


Hope this helps.

-Dennis

Posted: Thu Dec 11, 2008 11:12 pm
by jka33331
Dennis,

Thank you VERY much for the detailed explanation. That was just what I was looking for. Your a life saver!! :)

Thanks again

Josh

Posted: Thu Dec 11, 2008 11:13 pm
by norbert
Denis wrote:Strangely, this command used to appear in LaunchBar 4's menus but doesn't in the LaunchBar 5 beta 1. But the keyboard shortcut still works. Hopefully, this is only an oversight in the new beta.

The command should still be there. Please check LaunchBar Preferences > Appearance > Compact Action Menu. Is this option set?

Posted: Thu Dec 11, 2008 11:25 pm
by Dennis
norbert wrote:The command should still be there. Please check LaunchBar Preferences > Appearance > Compact Action Menu. Is this option set?


Hmm, I did have the Compact Action Menu enabled but didn't see the command appear in any menu when I pressed the key combination.

I then turned the Compact Action Menu preference off, and I'm still not seeing the command anywhere. Perhaps I'm looking in the wrong place?

-Dennis

Posted: Fri Dec 12, 2008 9:50 am
by jpcirrus
It's in the menu accessed from the gear icon in the LB bar -- also accessed with ⌃→

Posted: Fri Dec 12, 2008 10:25 am
by norbert
Let me clarify: There are now two separate menus in LaunchBar 5:

(1) When you click (or right click) the selected item, you get a menu that contains actions specific to this particular item. So when you've selected a file, it contains actions such as "Rename" or "Move to Trash". When you've selected a song, it contains actions like "Play in Party Shuffle" or "Show in iTunes". This menu can also opened with Control-Right Arrow.

(2) When you click the gear wheel icon, you get a static menu containing commands that are related to the LaunchBar application itself, such as opening the Preferences, accessing the Help, or selecting new items. This menu is basically a copy of LaunchBar's main menu bar. Its purpose is to provide access to these main menu commands in cases where the menu bar is not visible (e.g. when running LaunchBar without a Dock icon, which also hides its menu bar).

Posted: Fri Dec 12, 2008 10:31 am
by Dennis
jpcirrus wrote:It's in the menu accessed from the gear icon in the LB bar -- also accessed with ⌃→


OK, thanks jpcirrus. I see it now. It also helps to actually have a file selected that's one of the supported formats. A PHP file is not one of the supported formats. :-)

One strange thing though is that the contents of the menu accessed from the gear icon in the LB bar is not the same as the contents of the menu displayed with ⌃→. None of the copy actions are available when I click the gear icon with the mouse.

-Dennis


UPDATE - Oops, crosspost with Norbert. Thanks for the clarification. That explains why I didn't see the command when clicking on the gear icon earlier. Old habits die hard.

Posted: Sun Feb 01, 2009 7:00 pm
by bigcloits
Dennis wrote:[*] Use LaunchBar's Text Clips feature. From LaunchBar help:

A text document whose filename ends with a special .clip.txt or .clip.rtf filename extension is treated as a Text Clip File. Opening such a file via LaunchBar inserts the file’s contents in the frontmost application. You can use this feature to quickly insert predefined text blocks in the currently edited document.


Gosh darn it, this just doesn’t work for me! When I select a .clip.txt or .textClipping file LB, it simply opens a clipping window in the Finder, just as though I had double-clicked the file in the Finder. There is no inserting. A definite insertion lackitude. It seems so straightforward. Bug? My exact steps are:

* Type a sentence in BBEdit.
* Select sentence.
* Drag selected sentence to the desktop to create .textClipping file.
* With BBEdit file window frontmost ...
* Activate LB and select the new clipping.
* Press return.

And then I get the Finder’s clipping window, instead of insertion into BBEdit.

Can anyone enlighten me?

Posted: Sun Feb 01, 2009 7:14 pm
by ludwigschubert
bigcloits wrote:Can anyone enlighten me?


Well... yes 8)
You need to change the extension to clip.txt.
By default it will be .textClipping or something like that.


EDIT: This doesn't work, see below for details!

Posted: Sun Feb 01, 2009 7:36 pm
by Dennis
To expand on Ludwig's response, you can add the .clip extension to the name of any text or RTF file to make LaunchBar treat it as a clipping (i.e. example.clip.txt or example.clip.rtf).

-Dennis

Posted: Sun Feb 01, 2009 8:04 pm
by ludwigschubert
Err… yes, to revoke my first response: I think Dennis' way is the only correct one (and the one I usually use, too).
It doesn't work with "real" Mac OS X clippings at all, does it?

For completeness' sake I will post my "New Text Clip" Script:

Code: Select all

-- New TextClip LaunchBar Action by ludwigschubert

-- If the string is empty, use the clipboard :)
my handle_string(the clipboard)

on handle_string(input)
   if input is "" then set input to the clipboard
   
   set clipFolder to POSIX file "/Volumes/Path To Your/Text Clips/" as string
   
   set clipName to input
   if length of clipName > 40 then set clipName to characters 1 through 40 of clipName
   
   set clipFile to clipFolder & clipName & ".clip.txt"
   
   try
      set open_file to ¬
         open for access file clipFile with write permission
      -- erase current contents of file:
      set eof of open_file to 0
      write input as text to open_file starting at eof
      close access open_file
   on error
      try
         close access file clipFile
         display dialog "Error"
      end try
   end try
   
   open location "x-launchbar:hide"
end handle_string


It takes text via selecting it + spacebar, by instant sending or - if you don't send it anything - from your clipboard.

You need to change the line "set clipFolder to POSIX file "/Volumes/Path To Your/Text Clips/" as string" to a path that is right for you!

regards,
Ludwig

Posted: Sun Feb 01, 2009 8:25 pm
by Dennis
Nice script, Ludwig. I'm going to save that one. :-)

And I think you're right, LaunchBar's clippings are not designed to work with OS X's clippings. At least the manual doesn't mention it, nor can I get it to work in my tests.

-Dennis

Posted: Sun Feb 01, 2009 8:40 pm
by ludwigschubert
Yeah, it's quite handy :)

I edited my first post to reflect your findings.
Thanks for double checking.

Posted: Mon Feb 02, 2009 6:22 am
by bigcloits
I must have the dumb. Something is just not adding up here for me. Let’s see if I’ve got this straight ...

LB will not insert the contents of a genuine Mac OS X “.textClipping” file, regardless of what you do to the filename?

But LB will insert the contents of a text file that has been renamed with a .clip prefix to the .txt extension which makes it appear as though it is a “clipping” (a “Text Clip File” in the documentation) but in fact it is just a text file with a particular sort of filename?

And yet LB will insert the contents of a text file (try it, works great), and it does that without the file naming runaround ... so what on earth is all this about?!

Yep, definitely can’t brain today! ;-)