Make a new note in note.app from selected text.

I just noticed a post on cult of mac  which showed how to make a new Automator  ” System Service To Save Text to Notes.app In Mountain Lion”

It is a nice idea but I was surprised that the Author used a copy to clipboard  Automator Action along with a  Run Applescript action

Screen Shot 2013-04-15 at 20.02.01

There is  some redundancy in this workflow as well as unnecessary GUI commands.

From the start the Service will take what ever text is highlighted (selected) in any application.

Then it is passed onto the  copy to clipboard action. Which copies the text input to the clipboard.

Next the  Run Applescript  action  goes    the  through the process of clicking menu items to create a new note and keystrokes to paste into it.


There is no need to use   copy to clipboard  when the service has already captured the highlighted (selected) text as it’s input.

The input  will be passed onto the  Run Applescript  action. Via the  Run Applescript  action’s input  variable.  Also Notes.app is scriptable  and you can create a new note with some know how. i.e I read the apps dictionary.

So the is no need for all the keystroking or clicking menus.

I want to add I am not knocking the original cult of mac post. But just want to post something that imho is how it should work.

 


So taking into account the above the service workflow is simplified as a single  Run Applescript  action that contains

[iframe /blogR/newnoteApp.html 700 300]

The  Run Applescript  action takes the input from the service, obtains a name for the note using the first  paragraph of the input text, and makes a new note.

Screen Shot 2013-04-15 at 18.28.20

There of course can be some refining of the applescript code. Which I may update here with. Or you can post a comment with yours.

Hi, Please Leave a Reply