Thanks for that, but it didn’t make any difference.
I’ve bitten the bullet, and thought I’d try and convert the Applescript file into Xcode.
However, I’ve struck a date conversion problem. trying to convert a saved paragraph of a date as text to a date tells me I’ve got a script error
My script (in part) is below. Setting the text date as date (as in Explored) throws the error.
I’ve tried setting testDate to text as well.
on SetUpFileTwo:{}
try
set ThisIsATempString to ""
set EraseTheFolderNames to {}
repeat with x from 1 to ((count of paragraphs in my FileCheckString) div 7)
set tempStorageName to (paragraph (x * 7 - 6) of my FileCheckString) as text
set TheTempFileName to ((my pathtodesktop) & "ftp Downloads:" & tempStorageName as text)
tell application "Finder"
copy size of (info for alias TheTempFileName) to tempFolderSize
end tell
set StartingSize to (paragraph (x * 7 - 5) of my FileCheckString)
set TestSize to (paragraph (x * 7 - 4) of my FileCheckString)
set OriginalSize to (paragraph (x * 7 - 3) of my FileCheckString)
set TestDate to (paragraph (x * 7 - 2) of my FileCheckString)
set ConfirmCycles to (paragraph (x * 7 - 1) of my FileCheckString)
-- In case folder/file is removed from host folder
if tempFolderSize < StartingSize then
set OriginalSize to tempFolderSize - 1
set StartingSize to tempFolderSize
end if
say 9
tell application "System Events" to display dialog TestDate as text —< Works
set tempDate to date TestDate as date —< Fails
say 9.1
if (current date) - tempDate ≥ TimeDelay then
say 10
if OriginalSize < tempFolderSize then
set ThisIsATempString to (ThisIsATempString & tempStorageName & return & StartingSize & return & tempFolderSize & return & tempFolderSize & return & (current date) as text) & return & 1 & return & DividerString & return as text
else
set ConfirmCycles to ConfirmCycles + 1
set ThisIsATempString to (ThisIsATempString & tempStorageName & return & StartingSize & return & tempFolderSize & return & OriginalSize & return & (current date) as text) & return & ConfirmCycles & return & DividerString & return
if ConfirmCycles > (my SetTheConfirmCycles) then set end of EraseTheFolderNames to tempStorageName as text
end if
else
say 11
set ThisIsATempString to (ThisIsATempString & tempStorageName & return & StartingSize & return & TestSize & return & OriginalSize & return & TestDate) & return & ConfirmCycles & return & DividerString & return as text
end if
end repeat
my writefile3(ThisIsATempString)
if EraseTheFolderNames ≠ {} then my SetUpPrinting(EraseTheFolderNames)
if PrintingFlag then my setToWrite()
on error errmsg number errNum
display dialog "ftp Watcher SetUpFile2" & return & errmsg & return & return & errNum giving up after 10
end try
my performSelector:"ReCycleSetUp:" withObject:(missing value) afterDelay:TimeCycle
end SetUpFileTwo: