Skip to content

Instantly share code, notes, and snippets.

@keefo
Last active December 20, 2015 14:49
Show Gist options
  • Save keefo/6149741 to your computer and use it in GitHub Desktop.
Save keefo/6149741 to your computer and use it in GitHub Desktop.
Post Weibo via Miao
if ([[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"com.beyondcow.Miao"]) {
//if find Miao on this Mac then post text via Miao system service port
NSString *text = @"Hello world!";
[[NSPasteboard generalPasteboard] clearContents];
[[NSPasteboard generalPasteboard] setString:text forType:NSStringPboardType];
NSPerformService(@"Miao Post Weibo", [NSPasteboard generalPasteboard]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment