I’ve got a need for a script that can detect changes on an FTP site (i use RBrowser), download the changed files, determine their resolution and drop them into an appropriate Compressor Droplet. Now, I’m completely new to Applescript but I’m amazed at what people can do with it. Where should I start?
Alright, I started with a folder watching script I found online and added onto it. My ActionScript knowledge helped a litlte. I’ve gotten it to use Quicktime to identify the dimensions of the video and then direct it to the appropriate droplet. It’s really sweet and I’m really proud of myself.
I still need the part that watches the FTP folder for changes. Does anyone know what FTP program I can use that’s more scriptable than RBrowser? I noticed the dictionary for it isn’t very extensive.
the major question is: in which way does the folder change? Does the size of the files change by overwriting or will be added new files?
I guess, there is no need of an external application. the powerful shell command curl could be able to do the job
New files will be added and old files will be deleted. I just need to be able to detect and download new files. I guess if could poll the server every half hour or so and download any file with a last modified date within the last 30 minutes that would work.
That looks pretty good. I’d still like to do it with Applescript if I could, just for fun. I created an FTP upload folder using curl, I just can’t seem to find a way to watch the ftp site for new files to download. I got finder to mount the ftp folder to the desktop but I’m not sure where to go next.
Question:
Currently my script opens the video file in Quicktime and gets the resolution in a 2 item list ie [720, 486]. Is there any way to get the resolution of the video file with Finder? not having to open it in Quicktime?
You can do this with System Events
set f to "path:to:movie.mov"
tell application "System Events"
tell (1st track of contents of QuickTime file f whose dimensions is not {0.0, 0.0})
set {_width, _height} to dimensions
end tell
end tell