Jump to content

Quick Action Script to convert User Note into a Spreadsheet


Joe Weaks

Recommended Posts

 

Here is a simple script that converts the text of a User Note to Tab format and places it on the clipboard read to paste into a spreadsheet.

You can select text of a User Note and then choose the "Convert Notes to Tab Format" script as a Quick Action in the Services dropdown menu, or you can copy the text of the Note and then run the Shortcut. I have it bundled as a Shortcut for MacOS.

 

You can install the Shortcut with this link:

https://www.icloud.com/shortcuts/abb7e881c5424deaa286b0e31470aaeb 

 

915751631_ScreenShot2022-09-08at3_46_48PM.thumb.png.268abacdac605d5ddc8f8c7814cd36ee.png

 

It is a very simple script, that could choke with complicated notes. It removes all formatting (bold, italic). Here is the body of the script which you can also just run directly from script editor:

 

set theString to the clipboard
delay 0.3
set theResult to "Reference	Note" & return
repeat with n from 1 to (count paragraphs in theString)
	set p to paragraph n of theString
	
	if p is "" then
		-- is empty line
		-- skip line
		
	else if (character -1 of p is in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}) and (length of p < 22) then
		-- is a scripture ref
		set theResult to theResult & p
		
	else
		-- is a not
		set theResult to theResult & "	" & p & return
		
	end if
end repeat
set the clipboard to theResult

 

Edited by Joe Weaks
  • Like 1
Link to comment
Share on other sites

8 hours ago, Joe Weaks said:

script as a Quick Action in the Services dropdown menu

Hi Joe, is this a Mac OS feature only as I do not see anything like a script capability in Windows 11?

 

Link to comment
Share on other sites

51 minutes ago, cweber said:

is this a Mac OS feature only

It is a macOS only feature. Sorry about not specifying. Windows does not have a comparable automation and scripting framework in the UI.

This could be written as a perl script, though.

Link to comment
Share on other sites

Thanks for the clarification.

 

If the User notes layout of each heading and text were consistent then Power Automate would be the simplest approach.

 

Link to comment
Share on other sites

As I said above, I don't use User Notes, so am unfamiliar with their variation. For the quick notes I just made, it worked splendidly to automate.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...