I have a lot of text on the file My_Note_Backup.txt
Each time I run an another script, it added to this text something like
demo
demo
{
demo demo demo
demo
}
demo ...
and this repeats around 60 times a day.
How can I have an AppleScript which copies only the last note in between { and }
I have the text delimiter here, but how can I get the most recent text only?
set theName to ""
set theName to the clipboard
set theText to Unicode text
set theSource to theName
property leftEdge1 : "{"
property rightEdge2 : "}"
try
set saveTID to text item delimiters
set text item delimiters to leftEdge1
set classValue to text item 2 of theSource
set text item delimiters to rightEdge2
set theName to text item 1 of classValue
set text item delimiters to saveTID
theName
end try
set the clipboard to theName
the text file is
set dataBackupFile to (path to desktop folder as text) & "My_Note_Backup.txt"