Forums: Back End:

 

Anybody know their way around Applescript?

first
 

JERKSTORE Anybody know their way around Applescript?

I have a client that needs some automated workflow (specific to Macs obviously) created and I'm thinking it can be done with Applescript, but I don't know anything about Applescript so I want to check with someone who does first.

Basically, the client needs to add hundreds of photos to a website at a time. The photos need to be added via a php script, rather than just FTP'd to the server, because they each need a database entry created.

So I'm thinking I can write an Applescript that, when pointed to a folder containing the images, will loop through each and use cURL to connect to my PHP script that will not only actually upload the image file to the server, but generate the database entry for each image.

I found an example online of part of what I'm thinking:
HOT XXX SQUID PORN
which basically details how to connect to the form and simulate a file upload.

So I just need to know if this will be possible to set up as a workflow that can be applied to a whole folder of images? And how does a client activate the script - do they have to go through terminal or can I set it up to be more user friendly (for dumb clients)?

 

JERKSTORE

Or, if there is a platform agnostic way to do this, I'm all ears. It doesn't have to be Applescript by any means, but the client's points for generating the photos all seem to be Mac's at this point.

But if there is a better or easier way to do this, I'm all ears.

Anything that means someone doesn't have to upload 500 images one by one via a form.

------

PS - this is an ongoing need - the client will be uploading hundreds of photos from different events many times, not just this one time.

 

WingNut

when you do figure this out, can you post a simple explanation.

 

Stickman

In your situation, I'd keep it simple:

- upload the files to a 'holding area' with FTP
- write a PHP script, that can be invoked from a web page, that looks in the holding directory and processes anything that's there, creating DB entries and whatever else needs to be done.

That way it's platform-agnostic because you can FTP from any OS and use nay browser to launch the script. For dumb clients, I'd look at hooking up some kind of FTP drive mount so they can just drag+drop files like they would to move them around on a desktop. You could even make it the script run on a cron job, for added dumb-proofing.

StickBlog - random developer stuff
quote
 

the real me

i've had to do something similar before. i'm with stickman, have a script process the files from a directory. if you still need to automate the upload there is an automator action that will ftp them for the client.

 

JERKSTORE

That's probably a better idea - thanks guys.

I'll look into having the PHP script run on a holding folder on the server, rather than trying to have the script individually upload each file itself.

 
first
 

Forums: Back End: Anybody know their way around Applescript?

 
New Post
 
You must be logged in to post