Created
August 10, 2013 14:49
-
-
Save jamesstout/6200704 to your computer and use it in GitHub Desktop.
Geeklets - notes.applescript - http://www.macosxtips.co.uk/geeklets/system/need-help-with-this-script-/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Notes" | |
activate | |
delay 0.1 | |
end tell | |
try | |
tell application "Notes" to get note "geeknotes" | |
on error | |
set output to "No current note called geeknotes" | |
end try | |
-- now you have one note which has: | |
-- body | |
-- name | |
-- other properties | |
-- did you want to iterate through the lines of the note? | |
-- or maybe you have a folder called geeknotes? | |
try | |
tell application "Notes" to get folder "geeknotes" | |
tell application "Notes" | |
set notelist to every note of result | |
end tell | |
repeat with i from 1 to number of items in notelist | |
set this_note to item i of notelist | |
-- again, you now hoave one note with the same properties I mentioned earlier. | |
end repeat | |
-- if you just wanted to count the notes | |
-- skip the repeat above and | |
set output to number of items in notelist | |
on error | |
set output to "No current folder called geeknotes" | |
end try | |
-- use AppleScript Editor to see what properties a folder has | |
-- there will be a list of notes to iterate through. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment