Jump to content

PrependText2File


Recommended Posts

I've just created a new workflow for prepending text to a specific text file.  I personally use it for quickly capturing ideas for blog posts or projects to a file for review later.  I don't want this stuff cluttering up my real projects in OmniFocus.  The reason for prepending is having the newest ideas at the top of the file.  I'm definitely looking for any feedback other than "your 5 minute pixelmator icon sucks." ;-)

 

Script Logic:

  • Creates a to the second timestamped backup under /tmp
  • Verifies the backup is good via md5 matching before proceeding
  • Overwrites the original file with the input you provide
  • Appends the contents of the backup to the original — thus giving you prepend behavior!  =)
 

You can find the workflow file and README here:


 

Here is a paste of the current README.md as well:

 



# PrependText2File
## Alfred 2 workflow for prepending text to a file


## Contact: chadhs@digitalnomad.im
## Credits: script & terrible placeholder icon by Chad Stovern


## Installation Instructions


- double click the workflow file to install
- edit the keyword input to your liking
- edit the embedded bash script line that defines your target text file to prepend to (NO RELATIVE PATHS); look for this section:


#############################
## SET YOUR TEXT FILE HERE ##
#############################
original="/Users/username/Dropbox/yourfile.txt"


### Optional Notification Support


- if you'd like desktop notifications install terminal-notifier here: https://github.com/alloy/terminal-notifier/downloads ***NOT*** the ruby gem install


## Usage


- activate alfred and type in your keyword
- after your keyword type the exact text you want to prepend to your file
- press enter to prepend


## Protips


- install the plugin more than once and choose a different keyword to create shortcuts to prepend to multiple files
- change the name of the workflow AND the keyword title for each file you install it for


example keywords:  ppideas ppprojects ppblog

Edited by chadhs
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...