I'm specifically looking to design a custom action for LaunchBar so that I can initiate a tweet from that utility. Since Notification Center has a "Click to tweet" button, I wondered if Notification Center has any hooks that would allow me to script this without waiting for the developer of the program add a function to perform this action.
|
|
Apps can hook into the sharing options with the new NSSharingService API. It sounds like custom LaunchBar actions can be made with any UNIX executable file, so you could probably write a small command line tool (or you may need to build an actual app — you'll have to test it out) which activates this API (using Update: to initiate a tweet from AppleScript, you can do the following:
Furthermore, you can toggle the "Show Alerts and Banners" / do not disturb mode:
(This is all very specific to the current window layout of Notification Center and is likely to break with future OS X updates — but there will probably be easy fixes.) |
|||||
|
|
None that I know of (and in fact I think that having a Twitter/Facebook quick post area inside the notifications area is actually dumb (should be a widget really), and I have turned it off) but you can use the command line to both send a read tweets, as mentioned in this webpage, extracts below: To display a list of tweets (replace osxdaily with a twitter username of your choice):
To update your twitter status:
|
|||||||||||||||||
|
|
Taking this all one step further and putting together what we've learned so far, here's a fully programatic tweet:
Of course this is fragile, but for now, it works. I'd love to find a real hook, but UI Scripting is a workaround. |
|||||||||
|
|
Brilliant command shift D. Adding:
|
|||
|
|
|
I wrote another script that fixes some issues in the script posted by Ewwis:
It doesn't work when the Notification Center sidebar is open though.
It would be easier to just use the API. |
|||||
|
|
Fantastic! Thanks for showing the world another way. My solution worked for ME, but so does yours. I'm not an Applescript expert by FAR, but I do love fiddling with it. Thanks! Using what I've learned from you, here is another way that works for me. This doesn't address some of your concerns about alternate keyboards or errors, but maybe it will shed a light for someone dabbling in AS.
|
|||
|
|