Page 1 of 1

OSX Services

Posted: Wed Aug 02, 2017 11:01 am
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>

Re: OSX Services

Posted: Sat Aug 05, 2017 4:02 pm
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)