Jump to content
Carlos-Sz

Notes with New Text File with Tag 4.0 (nvALT, direct paste, new file in Finder and more)

Recommended Posts

Notes with New Text File with Tag 4.0


Overview

Easily create new tagged plain text files.

Synchronize your notes by selecting a Dropbox folder as your working folder.

View your notes, including tags, with an application such as nvALT.


Setup

You can configure the workflow anytime by typing the keyword setup-nft though you will be prompted to do it if it is the first time you run the workflow.

nft4_4.png

There are 6 steps.


1. Select the Working Folder

Type the name of the folder that you want to save your text files.

You can select a Dropbox folder to synchronize your files.


2. Set the Preferred Extension

In order to make things faster, the workflow adds the file extension automatically.

Here you can set your preferred text file extension. The default is .txt.


3. Set the Journal Name

Journal is a single file to easily add text with current date (default name is Journal).


4. Set the Date Format

This setting will be used in every Journal entry, Prepend text to a file or Append text to a file.

Select a format or use the following variables to build a custom one:

  • $m (month as number)
  • $mm (month)
  • $d (day)
  • $w (weekday)
  • $y (year)
  • $h (hour)
  • $n (minute)
  • $s (second)
  • $f (full date and time)

5. Set the Filename Timestamp

Configure a custom date format, such as $y$m$d$h$n$s, that can be easily added to a filename by using the variable $t e.g. nf #my file $t

You can build a custom one in this setup step by using the following variables:

  • $m (month as number)
  • $mm (month)
  • $d (day)
  • $w (weekday)
  • $y (year)
  • $h (hour)
  • $n (minute)
  • $s (second)

6. Markdown URL ON or OFF

If the topmost application is Safari, Google Chrome, Firefox or OSX Mail the workflow will append the URL to the new file; to get it in a markdown style select ON.


How to use the workflow

  • Select a text in e.g. Safari
  • Bring Alfred and type the keyword nf
  • Click New File from Text Selection

Done! A new note will be created in the working folder, named based on the selected text, tagged with Safari (the topmost application) and with the URL appended to it. See advanced features below.


Triggering

  • Keyword nf? - shows some syntax tips along with access to the Help file (see screenshot below)
  • Keyword setup-nft - workflow preferences
  • Keyword nf - add content (see details below)
  • keyword ns - search content (see details below)
  • Hotkeys - that are 4: create a new note from text selection, create a new note from the clipboard content, add selected text to the journal and bring the search feature
  • Fallback search - you can add this workflow to your Alfred fallback search preferences

nft_help.png


Add content: keyword nf

nft_nf.png


Keyword nf overview

Note: the New File from Mail Selected Messages item is displayed only if the topmost application is the Mail application.

Here you can find four ways to easily create a new text file:

  • New File from the Clipboard
  • New File from Text Selection
  • New Blank File
  • New Note
  • New File from Mail Selected Messages

Note: New File from Mail Selected Messages (item 5) will be displayed only if the topmost application is the Mail application.

In resume, the workflow can create a new text file with content from the clipboard (item 1), from the text selected in another application (item 2), from Messages selected in Mail (item 5) or typed directly in Alfred window (item 4). In addition, you can also create a New Blank File (item 3) that will be opened in the default text editor so you can enter the content right away.

Although it is not required to type any additional text (items 1, 2, 3 and 5), this module works with the following pattern: tags#filename

It means that you can enter tags (separated by comma) right after the keyword nf then type a hash sign then type the filename (in New Note the filename and the note itself are the same). For example: nf tag1,tag2#filename


Advanced features

Most advanced features are shared by all items displayed by the keyword nf:

  • type tags in Alfred window separated by comma e.g. nf tag1,tag2
  • remove the default tag (topmost application name) by adding a minus sign at the end of the tags e.g. nf tag1,tag2- or nf -
  • add a custom filename by typing a hash sign after the tags e.g. nf tag1,tag2#filename or #filename
  • add a custom filename and extension e.g. nf tag1,tag2#filename.md
  • add the filename timestamp configured in the workflow setup by using the variable $t e.g. nf tag1,tag2#filename $t
  • add a custom timestamp to the filename using the following variables: $m (month as number), $mm (month), $d (day), $w (weekday), $y (year), $h (hour), $n (minute), $s (second)
  • tell the workflow to not append the URL by adding “at sign” at the end e.g. nf tag1,tag2#filename.md@ or nf tag1,tag2@ or nf @
  • tell the workflow to not add the date in Prepend or Append text features by adding -d at the end e.g. nf #my note-d or #my note@-d
  • hold command key to create the new file in the topmost Finder window instead of the working folder
  • hold control key to prepend text to any file instead of create a new one: a list with your files will be loaded in Alfred so you can easily select it
  • hold option key to append text to any file instead of create a new one: a list with your files will be loaded in Alfred so you can easily select it
  • hold shift key to add text to your journal

Mail app special feature

There are two ways to take advantage of the special workflow Mail feature:

  • by selecting a text in an email, bring Alfred, type the keyword nf then select New File from Text Selection. Use this approach if you need only some text of the email.
  • by selecting messages in Mail, bring Alfred, type the keyword nf then select New File from Mail Selected Messages. This is the easiest way to add the entire email content.

Along with the text content, the workflow will prepend a short header with the most important information about the email and it will append the message link or URL (clicking it will open the original message in Mail).


Journal

The Journal feature is a single file to add new text with a timestamp (current date). You can set a custom date format in the workflow setup (keyword setup-nft).

To add a new Journal text:

  • Bring Alfred and type the keyword nf
  • Select the text content (from Clipboard, from Text Selection or New Note)
  • Hold shift key and hit return key

You can also use the Journal hotkey to easily add a new entry based on text selected in another application.


Search content: keyword ns

nft_ns.png

Search text files saved in the working folder:

  • the default search includes text content, filename and tags
  • start with c: to search content only
  • start with n: to search filenames only
  • start with t: to search tags only
  • hold control key to paste the text file content direclty to the topmost application
  • hold option key to add tags to a text file
  • hold command key to reveal the file in Finder
  • hit shift key to preview a text file (OSX Quick Look)
  • hit return key to open a file
  • the first item in Alfred is always “Show in nvALT” (if the application is installed): click it to view the results in nvALT

Note that you can tag a file from the search window by holding option key. The workflow will list all openmeta recently used tags so you can easily select one. You can also create new tags separeted by comma e.g. tag1,tag2,tag3.

nft4_5.png


What’s new

Version 4.0

  • streamlined features focused on content creation
  • keyword nf instead of newf
  • keyword ns instead of news
  • prepend or append text to any file in working folder
  • custom date format that will be used in Journal, Prepend and Append features
  • custom filename timestamp ($t) that can be used to create a filename
  • easily add text from Mail app (selected or all email content) along with basic email information and link or URL
  • select plain URL or Markdown URL format
  • workflow preferences and initial setup within Alfred
  • keyword nf? for Help within Alfred too
  • you can tag any file from search feature: type ns keyword, highlight a file, hold option key and hit return: a list of openmeta recent tags will be displayed in Alfred (select one or create new tags separated by commas)
  • New Note now works more like the other features: tags#note here or #note here
  • improved search module (keyword ns)
  • add a custom timestamp to the filename using variables
  • fn key is not used by default due wired Apple keyboards
  • workflow update to Alfred 2.0.3 (187)
  • removed Copy Text File from Finder

Version 3.0

  • Create a new file in Finder (hold control key)
  • Optionally add a file extension (see Help for details)

Version 2.8

  • Paste a note to the topmost application (e.g. start a search, select a note, hold fn key and press Return)

Version 2.7

  • Select a default extension (.txt or .md)
  • Faster searching feature
  • New icons

Version 2.5

  • Alfred Fallback search (you have to add it to your fallback search list)
  • Add @ at the end to not add the URL

Version 2.0

  • Journal (add text to a custom text file)
  • Search notes within Alfred
  • nvALT support
  • Alleyoop workflow support

Download

PS: thank you twinpeaks for your feedback

PS: post wrote in Byword and converted using Markdown to BBCode workflow

Edited by Carlos-Sz

Share this post


Link to post

I didn't offer much, this workflow is simply amazing though. I haven’t messaged you with any problems because so far it is smooth sailing.

 

Now that I think of it, an easy way to change your "working folder directory" if you decide to move locations later... most won't use it and reverting just calls for clearing out related cache etc... but only thing I can think of... really trivial. Thanks again for sharing. Use it all the time, handy as heck.

Share this post


Link to post

I didn't offer much, this workflow is simply amazing though. I haven’t messaged you with any problems because so far it is smooth sailing.

 

Now that I think of it, an easy way to change your "working folder directory" if you decide to move locations later... most won't use it and reverting just calls for clearing out related cache etc... but only thing I can think of... really trivial. Thanks again for sharing. Use it all the time, handy as heck.

 

Thank you twinpeaks. Your feedback was really great and helpful.  

Share this post


Link to post

Thanks Carlos, great workflow. Btw, I very much agree with flamerz, it'd be great to be able to append the text on a previously existing

file

 

I’ll see how can add such feature and I’ll let you know.

Share this post


Link to post

I’ll see how can add such feature and I’ll let you know.

Whoops and I just sent you a message about appending or better yet prepending to one file. Argh I should have read the forum first.

Share this post


Link to post

Whoops and I just sent you a message about appending or better yet prepending to one file. Argh I should have read the forum first.

 

No problem. 

 

There are two features that I may add:

 

- select any text file from the working folder to add a new piece of text

- have a set text file to keep appending new pieces of text

Share this post


Link to post

new file from clipboard is really nice.

 

It’s very handy indeed though I use text selection a lot.

 

 

@ all

 

The now called Journal feature is in progress and it will work like that:

 

- you set the journal name

- keyword + fn key: you can add text to journal from clipboard, text selection and typed note

- hotkey: you can add text to journal from text selection

- the full date and time will be added along with the URL (if any)

- new entries will be saved at the beginning of the journal

 

If you have a suggestion regarding the journal feature please let me know. Thank you.

Share this post


Link to post

Great work, Carlos.

 

This is easily the best file-creation workflow I’ve come across.

 

My only problem is that most of the time I’m not going to need the addition of clipboard information to a file. So, in order to use this workflow, I have to clear the clipboard manually before creating a note or appending to a note. Can you think of a better workaround for this?

 

Thanks again.

Share this post


Link to post

Great work, Carlos.

 

This is easily the best file-creation workflow I’ve come across.

 

My only problem is that most of the time I’m not going to need the addition of clipboard information to a file. So, in order to use this workflow, I have to clear the clipboard manually before creating a note or appending to a note. Can you think of a better workaround for this?

 

Thanks again.

 

Thank you.

 

By using the keyword newf you can also create a new file based on text selection, content typed by you in Alfred window or even a blank file. See screenshot below.

 

Hotkeys only work with text selection right now.

 

Please, let me know how you are working with the workflow (e.g. keyword or hotkey) and what exactly you need (a new keyword or hotkey). 

 

 

 

tnpt_2.png

Share this post


Link to post

Thanks, Carlos.

 

I’m using it with the keyword ‘newf’, but whichever option I choose – New Text File from Text Selection, New Blank Text File, Type the Text… – the content of my clipboard is pasted into the target file, including when holding down fn to append a journal entry. This, I believe, is the intended use for the workflow. 

 

What I am trying to achieve is Type the Text combined with fn to make a new journal entry without pasting in the content of the clipboard.

 

As an aside, I’m using the ‘Journal entry’ feature to append text to a scratchpad – a text file in nvALT where I collect random notes – rather than an actual journal.

Share this post


Link to post

@Wordius, I am not getting the same results... If I type something after "newf" with the last option, "Type The Text: ..." The only thing that get's added in addition to the actual string of text is the url of the site, if I am on a webpage, and the default tag - which with a " - " at the end can be dismissed completely.

 

No worries though, Carlos-Sz is definitely going to find a fix for you!

Share this post


Link to post

Thanks, Carlos.

 

I’m using it with the keyword ‘newf’, but whichever option I choose – New Text File from Text Selection, New Blank Text File, Type the Text… – the content of my clipboard is pasted into the target file, including when holding down fn to append a journal entry. This, I believe, is the intended use for the workflow. 

 

What I am trying to achieve is Type the Text combined with fn to make a new journal entry without pasting in the content of the clipboard.

 

As an aside, I’m using the ‘Journal entry’ feature to append text to a scratchpad – a text file in nvALT where I collect random notes – rather than an actual journal.

 

 

 

Please:

 

- download and install the workflow again

- bring Alfred and type newf

- now type a note

- now using the arrow keys go to “Type the Text” item

- hold fn key and press return key

 

Make sure “Type the Text” is selected before hitting return key.

 

Finally, are you typing any symbol in your note. Would you mind to share an example? Thank you.

 

@ thank you twinpeaks for your feedback. I have just tested in my Mac and everything is working as it is too.

Edited by Carlos-Sz

Share this post


Link to post

@Carlos-sz, @twinpeaks

 

The workflow is working as intended. The ‘clipboard’ content added to the note is the URL of the frontmost tab in Safari, as in the examples below. For the first note – at the bottom – I cleared the clipboard manually before appending the note.

 

Screen%20Shot%202013-04-02%20at%2019.43.

 

Should add that all I was trying to do was prevent the URL being added to the note. Most of these notes will be added ‘blind’, throughout the day. I wanted to avoid having to edit the file to remove all the URLs.

Edited by Wordius

Share this post


Link to post

Ah, I see. So it was the URL... I guess you can blame me for that request. It is very useful to have the link of where you grabbed a snippet of text or even had a thought that you recorded but I can see where your coming from. Carlos-Sz will probably make this very easy on you with a  modifier or something better but in the meantime I will look for a quick regex snippet you can run that will remove all http://.... lines form a file.

Share this post


Link to post

@Carlos-sz, @twinpeaks

 

The workflow is working as intended. The ‘clipboard’ content added to the note is the URL of the frontmost tab in Safari, as in the examples below. For the first note – at the bottom – I cleared the clipboard manually before appending the note.

 

...

 

Should add that all I was trying to do was prevent the URL being added to the note. Most of these notes will be added ‘blind’, throughout the day. I wanted to avoid having to edit the file to remove all the URLs.

 

OK.

 

In the next update, to remove the URL from “Add to Journal” you will have to add @ at the end of the text e.g. my note@

 

And in order to add a personal note* to a journal entry, it won’t be necessary to start with @ anymore.

Share this post


Link to post

@twinpeaks: I can certainly understand how useful it is to include a URL when filing snippets of text from web pages and elsewhere.

 

@Carlos-Sz: And with that, your single, multi-path workflow will replace four of my existing Alfred workflows. Brilliant stuff, and thanks for even entertaining the idea, let alone implementing it. 

Share this post


Link to post

@twinpeaks: I can certainly understand how useful it is to include a URL when filing snippets of text from web pages and elsewhere.

 

@Carlos-Sz: And with that, your single, multi-path workflow will replace four of my existing Alfred workflows. Brilliant stuff, and thanks for even entertaining the idea, let alone implementing it. 

 

Here is a first (beta) release to test: link

 

To remove the URL just add @ at the end in Alfred window (journal or not):

 

newf @
newf mytag@
newf mytag#myfilename@

 

 

I’m still testing the new version and I’ll update the initial page when tests are completely done.

Share this post


Link to post

@Carloz-Sz Download and tested. Works perfectly for me. Many thanks. When you’re finished testing, I’ll share the link to the download here.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...