Thanks Pete and MarkB.
Sorry for making my question not clearer and easier to answer.
Yes, my need, is to automate the copy to the clipboard process for many selected notes in groupings at a time, unfortunately not a single note. I initially thought a stamp “might” / “hoping” it would work since I do not know AppleScript.
My use case is very specific. I have my tinderbox medical knowledgebase that I am studying. I am transferring many selected note groupings from tinderbox to another medical database. I am curating the notes I select to transfer. I do not want to transfer en masse. As I read and study, I select the curated notes I want. I do not want to break my flow.
In my case, I will not import into a spreadsheet or need any delimiter format. I just need $Name \r $Text |n|n. that is it.
In Pseudocode:
NameOfTheNote
TextofTheNote
Space
NameOfTheNote2
Tex2ofTheNote
Space
Repeat
I think it translates to something like this:
$Name\r
$Text\n
\n
I found some older code Sumner had posted a while back to get me most of the way there. Here is the link to the original thread:
NB, it works perfectly for me but in case anyone wants to use the code, just make sure all curly quotes get changed to straight works. I would recommend using the link to the original code because I have noticed, in the past, when I paste code, it somehow gets changed to curly quotes in the post. Sorry, I have not figured it out yet.
Anyway, for my use case, the only part, left, I need to figure out (and working on now) is how to:
- Remove the top header row (which I do not need)
- Remove the " " beginning and ending each “$Name” “$Text” which I do not need.
Thanks
Tom
–
set grabAttribs to {“Name”, “Text”}
set myDelimiter to " "
– NO USER TINKERING NEEDED BELOW THIS LINE, at least in theory;)
set text item delimiters to quote & myDelimiter & quote
copy grabAttribs to attribVals
set numCols to grabAttribs’s length
tell application “Tinderbox 9”
tell front document’s selections – (note use of plural)
repeat with i from 1 to numCols
set attrName to grabAttribs’s item i
set attribVals’s item i to attribute attrName’s value
end repeat
end tell
end tell
set numRows to attribVals’s item 1’s length
set outStr to quote & (grabAttribs as string ) & quote & return # header row
repeat with i from 1 to numRows
set rowItems to {}
repeat with j from 1 to numCols
set rowItems’s end to attribVals’s item j’s item i
end repeat
set outStr to outStr & quote & (rowItems as string ) & quote & return # body row
end repeat
set the clipboard to outStr
–return outStr – uncomment this line to view output in Script Editor ‘Result’ pane
–