• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
OSX 10.11.1 Notes – Get Selected Note
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OSX 10.11.1 Notes – Get Selected Note


  • Subject: OSX 10.11.1 Notes – Get Selected Note
  • From: Christopher Stone <email@hidden>
  • Date: Wed, 11 Nov 2015 13:16:28 -0600

Hey Folks,

I just posted this on MacScripter.

I have Notes in the 3-pane Folders → Note-List → Note configuration.

When working on this I noticed I had some duplicate note titles, so I'm filtering by mod-date as well as name.

If anyone knows how to do this better I'm all ears.

--
Best Regards,
Chris

-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/11/11 12:45
# dMod: 2015/11/11 13:07 
# Appl: Notes.app & System Events
# Task: Acquire selected note for processing.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Notes, @System_Events, @Acquire, @Selected, @Note
-------------------------------------------------------------------------------------------

tell application "System Events"
  tell application process "Notes"
    tell (first window whose subrole is "AXStandardWindow")
      tell table 1 of scroll area 1 of group 1 of splitter group 1 of splitter group 1
        set selectedNotes to rows whose selected is true
        set theRow to item 1 of selectedNotes
        set noteTitle to value of static text 1 of UI element 1 of theRow
        set noteModDate to value of static text 3 of UI element 1 of theRow
      end tell
    end tell
  end tell
end tell

tell application "Notes"
  set noteList to notes whose name is noteTitle

  

  if length of noteList = 1 then
    set theNote to item 1 of noteList

    

  else if length of noteList > 1 then
    repeat with i in noteList
      tell (get modification date of i) to set modDateStr to its short date string & " " & its time string
      if modDateStr contains noteModDate then
        set theNote to contents of i
      end if
    end repeat

    

  end if

  

  set noteProps to properties of theNote

  

end tell

-------------------------------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Setting a New Field in a Record?
  • Next by Date: Re: AppleScriptObjC Problem?
  • Previous by thread: Re: AppleScriptObjC Problem?
  • Next by thread: Re: OSX 10.11.1 Notes – Get Selected Note
  • Index(es):
    • Date
    • Thread