L
Lau
Guest
Original poster
This just made me very pleased to be using OSX.
I'm building a new website, right, and I want to have a new image on the front page each day. (An image o' the day, if you will
) I know I could automate this, but I also want to choose (or even create) the image the day before, so I wouldn't have a load of them saved or uploaded in advance.
Now a friend of mine is struggling with php and all sorts for his site, for daily news and suchlike. As mine was just a case of uploading a new (identically named) image daily and php looks fairly difficult, I had resigned myself to logging in to FTP and uploading an image each morning over breakfast. Not a huge problem.
But then I thought of Applescript (which I'd never used before), poked around in the help, and used the "Record" function to tell the script to open Fetch, log in, upload the file off the desktop and then quit Fetch. Then I went into iCal, and set it to do it at 9 am every morning. Tested it, and it works.
And if I'm not on the computer at 9, I can just click on the script once I am, which is still so much less hassle.
Isn't that great? Two programs that you get free with a Mac and a n00b like me can understand that are going to make this so much easier.
<Pleased>
Here's the script in case anyone wants to do anything similar in the future.
<Goes off to write more Applescripts for everything>
I'm building a new website, right, and I want to have a new image on the front page each day. (An image o' the day, if you will
Now a friend of mine is struggling with php and all sorts for his site, for daily news and suchlike. As mine was just a case of uploading a new (identically named) image daily and php looks fairly difficult, I had resigned myself to logging in to FTP and uploading an image each morning over breakfast. Not a huge problem.
But then I thought of Applescript (which I'd never used before), poked around in the help, and used the "Record" function to tell the script to open Fetch, log in, upload the file off the desktop and then quit Fetch. Then I went into iCal, and set it to do it at 9 am every morning. Tested it, and it works.
Isn't that great? Two programs that you get free with a Mac and a n00b like me can understand that are going to make this so much easier.
<Pleased>
Here's the script in case anyone wants to do anything similar in the future.
Code:
tell application "Fetch"
activate
make new transfer window at beginning with properties {hostname:"mysite.co.uk", username:"username", password:"password"}
open remote item "www"
open remote folder "Images"
put into transfer window "mysite.co.uk" item alias "me:Users:me:Desktop:imageotheday.jpg" format Automatic without uniquename
quit
end tell
<Goes off to write more Applescripts for everything>