Jump to content

foxtrot

Member
  • Posts

    3
  • Joined

  • Last visited

Reputation Activity

  1. Like
    foxtrot reacted to surrealroad in Notes   
    Very interesting!
    So the thing to do would be to modify the alfred_library.scpt in the bundle:
    on createNote(noteTitle, noteBody, notesFolder, notesAccount) tell application "Notes" if notesAccount is not "" then tell account notesAccount if notesFolder is not "" then tell folder notesFolder to set theNote to make new note with properties {name:noteTitle, body:noteBody} else tell first folder to set theNote to make new note with properties {name:noteTitle, body:noteBody} end if end tell else tell first account if notesFolder is not "" then tell folder notesFolder to set theNote to make new note with properties {name:noteTitle, body:noteBody} else tell first folder to set theNote to make new note with properties {name:noteTitle, body:noteBody} end if end tell end if end tell --this is the bit that will open the note set old_delim to applescript's text item delimiters set applescript's text item delimiters to "/" set noteFile to (last text item of theNote's id) & ".notesexternalrecord" set applescript's text item delimiters to old_delim do shell script "find ~/Library/Containers/com.apple.Notes/Data/Library/CoreData/ -name " & quoted form of noteFile & " |xargs open" end createNote I'm actually considering putting this into the released workflow, maybe via a modifier key. Very cool!
  2. Like
    foxtrot got a reaction from surrealroad in Notes   
    Thank you for the pointers. I modified the end of the 'run script' to reflect the following: else lib's createNote(first paragraph of q, q, notesFolder, notesAccount) set theResult to "Created note: " & q tell application "Finder"   open (every item of folder "Macintosh HD:Users:USERNAME:Library:Containers:com.apple.Notes:Data:Library:CoreData:ExternalRecords:XXXX-XXXX-XXXXX-XXXXX:IMAPNote:_records:0" whose modification date is ((get current date)))  end tell end if return theResult end alfred_script It seems to work as intended. My only remaining curiosities are "is this inefficient (best practice)" and "can I place/focus new text input at the end of the now-filled 'query' text"?
  3. Like
    foxtrot reacted to surrealroad in Notes   
    That's an interesting approach. You can probably just append to the workflow a call to system events to find the most recent file in a given folder, and then just use the open command to launch it. That said, I have no idea whether this would even work _outside_ of this workflow.
  4. Like
    foxtrot got a reaction from surrealroad in Notes   
    Jack James, 
     
    Thank you for sharing your work flow.
     
    I do have a question, though: Would it be possible to open Notes.app and focus on the newly created note? It seems picky, but it would greatly streamline the creation process for me. My conceptualization of the process would be to "simply" open the newest '.notesexternalrecord' file in the notes folder, but I have no idea where to start with this modification. Any help would be much appreciated.
×
×
  • Create New...