Is there a way to upload to through automator?
October 17, 2013 3:41 PM   Subscribe

I would like to upload a file to through either automator or applescript and have that function (action) return the shared URL for use later in the script. Is there an easy way to do that?

I'm comfortable with modifying scripts in python and applescript, but when it comes to programming something like this - it's hard to come up with the steps that I need. Looking at the API docs, curl is used as an example - but I can't figure out to get that to work within an automator action or applescript droplet.
posted by Brent Parker to Technology (3 answers total)
Doesn't look too difficult. Automator can call a shell script or a python script. It should be easy to run curl from that script. curl should get back a json response that includes a field for the URL of the uploaded file which it will output to the script. The script could parse the json as json to extract the value, or, probably easier, you could extract it with a relatively simple but targeted regular expression, which the script would then output for Automator's use. I'll note here though, I'm glossing over the exact interface between automator and the script, but it looks like there are some examples avalable via the Google.
posted by Good Brain at 11:17 PM on October 17, 2013

Best answer: Looks like the community has a Box python module. I'd start there. The provided example even shows how to upload a file.
posted by sbutler at 11:24 PM on October 17, 2013

Response by poster: That's exactly what I was looking for sbutler.
posted by Brent Parker at 7:22 AM on October 18, 2013

« Older Tall women of Metafilter: where do you buy your...   |   Help Me Brainstorm the Planning of a... Newer »
This thread is closed to new comments.