Hacker News new | past | comments | ask | show | jobs | submit login

It's time to write the eulogy for application automation and inter-application communication on the Mac.

AppleScript (beast that it is) was innovative when it was created, and still has not been replaced. Automator is built on AppleEvents, and with sandboxing will come a sharp decline in the number of applications that can receive AppleEvents and the extinction of apps that send them.




Not at all!

Sandboxing brings with it XPC, which is an IPC framework for doing very fast and awesome message passing.

It's got some great features for separation of privileges. For instance, you might have an XPC sandboxed process for, say, rendering a H.264 video to a buffer. That process never gets access to the filesystem, the graphics card, or anything apart from the strip of memory that contains the file, and the buffer it has to write its pixels to.

Then you can use this to render a H.264 video in your application, and if a buffer overflow is found that could lead to a video containing shellcode to be executed, you have no fear that bad things can happen to the filesystem or users' stuff.

If I'm not mistaken, I'm pretty sure XPC is how they implemented the crazy feature where you open a QuickLook window on an image or something in the Finder, and if you it the Open with Preview(.app) button, the Finder's QuickLook window turns into a Preview window.


I tried very hard at WWDC this year to get a comment on this. Nobody would clarify if XPC could be used in the way Apple Events are...

All the documentation I could find were about splitting your single app into multiple processes, and using XPC to communicate between them. Does XPC provide a way to query the interface of an app you don't own? Can I ask for an XPC "dictionary" a la AppleScript?


/me tries the quicklook -> preview thing

That's kinda cool... never tried that before.

But yeah. Sandboxing does not at all imply not-scriptable. It tends to imply breakage with older systems of scripting, but that's about all, and only until wrappers are made.


It doesn't imply it theoretically, but Apple hasn't pointed out a way that scripting is going to be a part of their ecosystem. Apple Events -are- going away. XPC doesn't work like that. What's left?

They could theoretically introduce a newer and better way to do this... Apple Events were far from... well far from usable actually in most cases... but I've seen amazing things built on them. The thought of easy public inter-application communication and automation going away makes me uneasy.

Imagine if Twitter, Facebook, or Google decided to kill all their APIs some time next year... This is like that on a more personal scale.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: