How to Create a Simple Service to Append Text to a file
Quick Mac Tip, 30 January 2011
Quickly adding URLs and text clippings to a file after I’ve narrowed down my research helps me solve problems on a website I do volunteer maintenance for. I clip bits of code to rewrite and use to solve an issue or keep ideas for future development. Today I discovered that I could simply create a Service in Automator to do that for me.
This guest Tip is written by April Mains, Arteliance.
April Mains has been doing print design since 1985 and working with Mac computers since 1989. She has been hanging out with Miraz on everything from mailing lists to twitter since 1996. April began blogging in 2005 and can be found at Arteliance as well as on twitter and facebook.
Create A Simple Service in Automator:
- Open Automator and choose the
Set Contents of BBEdit Documentto the workflow area
By: Appendingfrom the drop-down menu (the other two options are:
Replacing Entire Contentsand
Saveyour Service with a descriptive name
Now I can simply select text and use the
OS X Contextual Menu > Services > [New_Service_Name] to append the selected text to a BBEdit text file. I use this mainly to add urls or snippets to the inbox of my todo list.
Append to BBEdit Scratchpad service already exists and might be useful as well.
Note that for this menu item to function, BBEdit must be running and a text document must exist.
You can also create an Automator app to
Ask for Text and then
Set Contents of BBEdit Document > By: Appending to enter your own text and add it to your todo list or text file.
Save as Application to
~/Library/Scripts and then use FastScripts (free for up to 10 keyboard shortcuts) to set a shortcut for your new program.