New topic: Zip file attached to Mail with AppleScript gets corrupted
<http://forums.realsoftware.com/viewtopic.php?t=47370> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message oleman108 Post subject: Zip file attached to Mail with AppleScript gets corruptedPosted: Fri Mar 22, 2013 1:56 am Joined: Tue Sep 02, 2008 3:01 pm Posts: 191 Location: Switzerland In RS I compress a REALDatabase file using ZipMBS and save this file to the Documents folder. If I open this zip file manually, by double-clicking on it in Finder, then it unzips as expected. The Zip file is ok at this point of the process. But in my RS program, I call an AppleScript to open Mail and attach the zip file to a new mail. The Realbasic code: Dim theSubject As String = "Backup of database " + dbFileNam Dim theBody As String = "Database Last Modification Date : " + d.SQLDateTime Dim theAttachment As String = SpecialFolder.Documents.Child(fName).NativePath OSXSendMail(theSubject, theBody, theAttachment) The AppleScript code: on run {theSubject, theBody, theAttachment} tell application "Mail" set newMessage to make new outgoing message with properties {visible:true, subject:theSubject, content:theBody & return & return} tell content of newMessage make new attachment with properties {file name:theAttachment} at after the last paragraph end tell activate end tell end run It seems to work as expected, but when I drag the attachment to the desktop (or also into the Documents folder) then I can no longer unzip this file by simply doubleclicking it. The error: However, I got "The Archive Browser" from the AppStore and with that utility it is possible to safely extract the original file. But I need a solution which does not require the user to purchase a third party expander for zip files. Somehow the AppleScript seems to alter the attachment. So maybe someone knows a safe way of attaching a RealSQLDatabase file to a mail and send it? _________________ "Stop deluding yourself with wishful thinking and find a solution that works for what you need to do" Tim Hare - on forums.realsoftware.com Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
