messages: (*class of theSelectedMessages is list*) (*count of theSelectedMessages is 1*) (*debugSwitch is true*) (*debugLog: perform mail with ShortMailDownload.scpt ====== Saturday, January 8, 2022 at 9:48:34 PM ====== perform mail *) (*intermediateFolder is Downloads:subFolderForMailDownload*) (*pathToHome is Catalina:Users:john:*) (*revised pathToHome is Catalina:Users:john:*) (*debugLog: Created folder Catalina:Users:john:Downloads:subFolderForMailDownload*) (*debugLog: Created final destination folder Catalina:Users:john:Students*) (*was activated*) (*class of aMessage is message*) (*debugLog: fromMail is 'removed' via TeamUnify *) (*debugLog: pathToStudents is Catalina:Users:john:Students:*) (*debugLog: Created final destination subfolder Catalina:Users:john:Students:'removed' via TeamUnify *) (*debugLog: pathToTheStudent is Catalina:Users:john:Students:'removed' via TeamUnify :*) (*save aFile*) (*debugLog: attachmentName is Wildcat Weekly Jan 4th.pdf*) (*fileName is Wildcat Weekly Jan 4th fileExt is pdf*) (*check for free name. clearCount is 0 destPath is Catalina:Users:john:Downloads:subFolderForMailDownload:Wildcat Weekly Jan 4th.pdf finalDestPath is Catalina:Users:john:Students:'removed' via TeamUnify :Wildcat Weekly Jan 4th.pdf*) (*debugLog: attempting to create free filename on error the errMsg is Failure of alias. number is -1*) EVENTS: tell application "Mail" (*fileName is Wildcat Weekly Jan 4th fileExt is pdf*) (*check for free name. clearCount is 0 destPath is Catalina:Users:john:Downloads:subFolderForMailDownload:Wildcat Weekly Jan 4th.pdf finalDestPath is Catalina:Users:john:Students:'removed' via TeamUnify :Wildcat Weekly Jan 4th.pdf*) display dialog "on error the errMsg is CanĂ¢ t make \"Catalina:Users:john:Downloads:subFolderForMailDownload:Wildcat Weekly Jan 4th.pdf\" into type alias. number is -1700" giving up after 10 display dialog "attempting to create free filename \r on error the errMsg is Failure of alias. number is -1" giving up after 20 (*debugLog: attempting to create free filename on error the errMsg is Failure of alias. number is -1*) end tell tell current application path to home folder as text end tell tell application "Mail" open for access file "Catalina:Users:john:tryAttachmentsLog.txt" with write permission end tell tell current application open for access file "Catalina:Users:john:tryAttachmentsLog.txt" with write permission end tell tell application "Mail" get eof 81 end tell tell current application get eof 81 end tell tell application "Mail" write "attempting to create free filename \r on error the errMsg is Failure of alias. number is -1\r" to 81 starting at 733 end tell tell current application write "attempting to create free filename \r on error the errMsg is Failure of alias. number is -1\r" to 81 starting at 733 end tell tell application "Mail" close access 81 end tell tell current application close access 81 end tell tell application "Finder" set creator type of file "Catalina:Users:john:tryAttachmentsLog.txt" to "R*ch" end tell Result: 0 REPLIES: (*class of theSelectedMessages is list*) (*count of theSelectedMessages is 1*) (*debugSwitch is true*) (*debugLog: perform mail with ShortMailDownload.scpt ====== Saturday, January 8, 2022 at 9:48:34 PM ====== perform mail *) (*intermediateFolder is Downloads:subFolderForMailDownload*) (*pathToHome is Catalina:Users:john:*) (*revised pathToHome is Catalina:Users:john:*) (*debugLog: Created folder Catalina:Users:john:Downloads:subFolderForMailDownload*) (*debugLog: Created final destination folder Catalina:Users:john:Students*) (*was activated*) (*class of aMessage is message*) (*debugLog: fromMail is 'removed' via TeamUnify *) (*debugLog: pathToStudents is Catalina:Users:john:Students:*) (*debugLog: Created final destination subfolder Catalina:Users:john:Students:'Alessio De Rosi' via TeamUnify *) (*debugLog: pathToTheStudent is Catalina:Users:john:Students:'removed' via TeamUnify :*) (*save aFile*) (*debugLog: attachmentName is Wildcat Weekly Jan 4th.pdf*) (*fileName is Wildcat Weekly Jan 4th fileExt is pdf*) (*check for free name. clearCount is 0 destPath is Catalina:Users:john:Downloads:subFolderForMailDownload:Wildcat Weekly Jan 4th.pdf finalDestPath is Catalina:Users:john:Students:'removed' via TeamUnify :Wildcat Weekly Jan 4th.pdf*) (*debugLog: attempting to create free filename on error the errMsg is Failure of alias. number is -1*)