I work at a newspaper, and we are getting ready to upload our pdfs into a folder on our ftp server. I would like to make it automated using apple script and fetch. Here is the script I have so far. The files will be in multiple folders, like
A Section, B Section, C Section, etc… My question is, is there a way to tell fetch to upload all the files in a folder without using the file names, the reason is some nights there will be only 10 files and other nights there will be 20 files in a folder?
Any help is very appreciated
Thanks
-- Get todays month
set themonth to month of (current date)
-- Get todays year
set theYear to year of (current date) as text
--Get today's day
set WDay to weekday of (current date) as text
-- Selecting the day Folder if it is less than 10 it adds a 0 in front
if day of (current date) is less than 10 then
set theDay to "0" & day of (current date)
else
set theDay to day of (current date) as text
end if
set theSource to "Out"
set theSourcehome to "Main EPS Pages"
-- Selecting the Month Folder
if month of (current date) is January then
set theInput to theYear & "01" & theDay
else if month of (current date) is February then
set theInput to theYear & "02" & theDay
else if month of (current date) is March then
set theInput to theYear & "03" & theDay
else if month of (current date) is April then
set theInput to theYear & "04" & theDay
else if month of (current date) is May then
set theInput to theYear & "05" & theDay
else if month of (current date) is June then
set theInput to theYear & "06" & theDay
else if month of (current date) is July then
set theInput to theYear & "07" & theDay
else if month of (current date) is August then
set theInput to theYear & "08" & theDay
else if month of (current date) is September then
set theInput to theYear & "09" & theDay
else if month of (current date) is October then
set theInput to theYear & "10" & theDay
else if month of (current date) is November then
set theInput to theYear & "11" & theDay
else if month of (current date) is December then
set theInput to theYear & "12" & theDay
end if
set myurl to ""
tell application "Fetch 4.0.3"
with timeout of 6000 seconds
open url myurl
make new remote directory at beginning with properties {name:theInput}
open remote directory theInput
put into transfer window "" item alias "Macintosh HD:Users:comp1:Desktop:Main EPS Pages:A Section:Out:gta001.pdf" format Automatic without uniquename
end timeout
end tell