Opening Share sheet

Hi there,

Does anyone know how to open a share sheet from AppleScript, especially for the Notes App?

I found some sources how to do it with Mail but it doesn’t work with Notes.

	set aService to current application's NSSharingService's sharingServiceNamed:("com.apple.Notes.SharingExtension")
	aService's setDelegate:me
	aService's setSubject:"Subject"
	set shareItems to current application's NSMutableArray's alloc()'s initWithObjects:"Body text to share"
	aService's performWithItems:shareItems
tell application "System Events" to tell ¬
	application process "Notes" to tell ¬
	menu bar 1 to tell ¬
	menu bar item "File" to tell ¬
	menu "File" to tell ¬
	menu item "Share" to tell ¬
	menu "Share" to tell ¬
	menu item "AirDrop" to if ¬
	exists then click

Hi CJK,

thanks for your suggestion. I know about that way, but it’s not localization proof. Apple even has changed localizations in the same language over the time.