OSX Services

Mac OSX specific forum
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

OSX Services

Post by Wolfram »

Does anyone has experience with OSX Services?
I wrote a small app that I want to open by Services Keyboard short cut.
I put these code into the info.plist, but I have to press ESC every time after I press my shortcut.
It seams so that I must send a message back to finish the service call.

Code: Select all

<key>NSServices</key>
	<array>
		<dict>
			<key>NSMenuItem</key>
			<dict>
				<key>default</key>
				<string>myService</string>
			</dict>
			<key>NSMessage</key>
			<string>openFile</string>
			<key>NSPortName</key>
			<string>myAppName</string>
			<key>NSSendTypes</key>
			</array>
		</dict>
	</array>
macOS Catalina 10.15.7
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Re: OSX Services

Post by Wolfram »

Just to let you know…

This code fixed my problem.

Code: Select all

  app = CocoaMessage(0,0, "NSApplication sharedApplication")
  CocoaMessage(0, app, "setServicesProvider:", app)
macOS Catalina 10.15.7
Post Reply