Opening Share sheet

#1

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
0 Likes

(CK) #2
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
0 Likes