Problem reading Reminders

I can create Reminders in AS but I cannot read them.

I get the name and ID of the list alright but the Container is always missing value and returns the “can’t get body” error.

I’ve searched for a resolution but so far have found many posts about creating a list but none about reading it.

Thanks for any help!

I think I got it.

Thanks anyway!

Why don’t you post it?

You may look at :
https://macscripter.net/viewtopic.php?pid=189515
https://macscripter.net/viewtopic.php?id=45602

CAUTION : due to encoding problems, in the late thread, some scripts need edition:

¢ must be replaced by •

⌘ must be replaced by ⌘

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 17 mars 2019 12:32:16

Thanks !

Is there the possibility to ask to the webmaster to find/replace every occurrence of these encoding problems with the correct character.
It append to me that often I cannot find the correct replacement, even searching with google. And render some of the old script useless. What a waste …

Ciao
L.

I asked to be given permission to edit these oddities.
Must wait for an answer.

Here are some of these oddities:

"⌘ " must be replaced by ⌘

“¬” must be replaced by ¬

“|” must be replaced by …

“'” must be replaced by ’

” must be replaced by —

“”" must be replaced by “

" " must be replaced by ”

  • nobreak must be removed

“¿” must be replaced by (I don’t know what)

“≔ must be replaced by (I don’t know what)

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 17 mars 2019 14:28:07

I looked at the instructions extracting the body.
When the script extract the body, the result contain tags like “

” and “
”.
Assuming that they are useless for your needs, I added code to remove them.

tell application "Notes"
	activate
	set folderNames to name of folders
	set chosenFolderNames to (choose from list folderNames with multiple selections allowed)
	if (chosenFolderNames is false) then error number -128 -- Cancel button.
end tell



-- Repeat with each chosen folder name:
repeat with i from 1 to (count chosenFolderNames)
	-- Get all the notes in the folder with this name.
	set thisFolderName to item i of chosenFolderNames
	tell application "Notes" to set theNotes to notes of folder thisFolderName
	
	-- Repeat with each note in the folder:
	repeat with thisNote in theNotes
		tell application "Notes"
			-- Get the relevant note data.
			set myTitle to the name of thisNote
			set myText to my supprime(body of thisNote, {"<div>", "</div>"})
			log myText
			set myCreateDate to the creation date of thisNote
			set myModDate to the modification date of thisNote
			set myAttachments to the attachments of thisNote
		end tell
		(*
		-- Get alias specifiers for any attachments.
		set attachmentFiles to {}
		repeat with thisAttachment in myAttachments
			-- Get this attachment's content identifier (cid) from Notes.
			tell application "Notes" to set thisCID to content identifier of thisAttachment
			-- Use it to look up the corresponding NSURL in the lookup dictionary and store the result as a file specifier.
			set end of attachmentFiles to (attachmentLookup's valueForKey:(thisCID)) as alias
		end repeat
		*)
	end repeat
	
end repeat


#=====
(*
removes every occurences of d in text t
*)
on supprime(t, d)
	local oTIDs, l
	set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
	set l to text items of t
	set AppleScript's text item delimiters to ""
	set t to l as text
	set AppleScript's text item delimiters to oTIDs
	return t
end supprime

#=====

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 17 mars 2019 15:54:24