Renaming a zipped file so it works on a PC
Renaming a zipped file so it works on a PC
- Subject: Renaming a zipped file so it works on a PC
- From: "Evan Goldstein" <email@hidden>
- Date: Fri, 05 Dec 2008 15:22:25 -0500
Hi,
I am using Applescript to tell Dropstuff to zip a file, tell the Finder to rename it with a name based on the current date, and tell Transmit to ftp it to a PC.
The problem I am having is when I try to open the file on the PC with Winzip, it says that the file is corrupted.
I have already put into place (perhaps the wrong place) the settings for Dropstuff to ignore the Macintosh info.
If I run the script to just zip the file and manually rename it via a cut and paste in the finder, then the file opens in Winzip.
If I run the script and have the script rename the file, then the file is corrupted.
Is there a cleaner way to rename the file that would hopefully not cause the corruption?
I don't have much experience at writing Applescripts so please forgive me if this is not great code in general.
Here is the part of the script that gets the current date, zips the file and renames it.
set mm to the month of the (current date) as integer
if mm is less than 10 then set mm to "0" & mm as string
set dd to the day of the (current date) as string
if length of dd is less than 2 then set dd to "0" & dd as string
tell application "DropStuff"
activate
zip {alias "/Users/admin/Desktop/Zip_to_do/MAGMLIDS.txt"} to file "network005-ftpfilemaker:Users:admin:Desktop:Zip_done" preserve macintosh content no
end tell
tell application "Finder"
set name of document file "network005-ftpfilemaker:Users:admin:Desktop:Zip_done:MAGMLIDS.txt.zip" to mm & dd & "2MAG.ZIP" as string
end tell
Any help would be appreciated.
Thanks,
Evan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden