Calling a shell script from Config.js

I have a JavaScript extension that I need to then call into a shell script to interact with the Apple Calendar.

Is there a way to execute a shell script from a PopClip JS module or snippet?

Hi, currently it’s not possible to call shell scritip of applerscript from within javascript. I’d like to add this in a future version.

Thanks Nick. I’m wondering if there is a possible way to do the following:

  1. Call OpenAI API using Javascript
  2. Based on the output of #2, which is an ICS blob, invoke Apple Calendar to create an event.

The only way I have found to create Apple Calendar Events is by downloading a .ics file and then launching Apple Calendar. There are no protocol handlers or deep links that work for Apple Calendar to generate an event. Also cannot seem to find a way to combine JS / AppleScript to pull this off.

I am considering just having some server side api that I create that allows the PopClip extension to pass on some params and then have it return an ICS file.

Open link to ICS file from a server sounds a clever idea.

Thanks for sharing your use case. It;s useful to have an idea what sort of capabilites might be missing.

Yep I got it working using a Cloudflare Worker which is just a TypeScript function.

I do an HTTP POST to the worker, make the ICS and then download it and use openUrl and it works great.

1 Like