Hello Here is my script and for some reason it does not work?
Can anyone point out my mistakes?
--This part is coming from cells in a Numbers document.
set grandParentMailbox to Client_Folder_name_clean
set parentMailbox to Client_foldernameDate
set childMailbox to file_name
tell application "Mail"
if (mailbox (grandParentMailbox) exists) = false then
make new mailbox with properties {name:grandParentMailbox}
set frontViewer to (some message viewer whose index is 1)
set selected mailboxes of frontViewer to {mailbox grandParentMailbox}
my waitTillFileExists(grandParentMailbox) & ".mbox"
end if
end tell
tell application "Mail"
if (mailbox (grandParentMailbox / parentMailbox) exists) = false then
make new mailbox with properties {name:grandParentMailbox / parentMailbox}
set frontViewer to (some message viewer whose index is 1)
set selected mailboxes of frontViewer to {(mailbox grandParentMailbox) / parentMailbox}
my waitTillFileExists(grandParentMailbox / parentMailbox) & ".mbox"
end if
end tell
tell application "Mail"
if (mailbox (grandParentMailbox / parentMailbox / childMailbox) exists) = false then
make new mailbox with properties {name:grandParentMailbox / parentMailbox / childMailbox}
set frontViewer to (some message viewer whose index is 1)
set selected mailboxes of frontViewer to {(mailbox grandParentMailbox) / parentMailbox / childMailbox}
my waitTillFileExists(grandParentMailbox / parentMailbox / childMailbox) & ".mbox"
end if
end tell
on waitTillFileExists(mBox)
set parentDir to "/Users/clbair2012/Library/Mail/V2/Mailboxes"
set theMailBoxFile to parentDir & "/" & mBox & "/Info.plist"
repeat while (my FileExists(theMailBoxFile) = false)
delay 4
end repeat
end waitTillFileExists
Here is the error message that I get
error “Can’t make "SAS - Safetool sas" into type real.” number -1700 from “SAS - Safetool sas” to real
SAS - Safetool sas is the “grandParentMailbox” picked up from my Numbers document.
Kind regards