Jump to content

Add note to FSNotes? how to....


Recommended Posts

Hi there. I'm new to Alfred and am trying to learn how to create workflows.

One thing I'd appreciate your help with is:

 

a way to trigger Alfred to open FSNotes (if it's not already launched) and then create a new note.

FSNotes does not offer a way to shortcuts.

 

Thank you in advance.

Link to comment
2 hours ago, silverlaker said:

FSNotes does not offer a way to shortcuts.

 

What do you mean?

 

In any case, FSNotes isn't scriptable, so all you can do is activate it and fire simulated keypresses at it to create a new note.

 

The following AppleScript will activate FSNotes (launching it if need be) and create a new note. Put it in a Run Script action with Language = /usr/bin/osascript (AS)

on run
	tell application "FSNotes" to activate
	tell application "System Events"
		-- wait up to 5 seconds for FSNotes to activate
		repeat 100 times
			set _name to name of first process whose frontmost is true
			if _name = "FSNotes" then
				-- show main window
				keystroke "\\" using command down
				-- create new note
				keystroke "N" using command down
				exit repeat
			end if
			delay 0.05
		end repeat
	end tell
end run

 

Link to comment
  • 2 years later...

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...