• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Renaming a zipped file so it works on a PC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming a zipped file so it works on a PC


  • Subject: Re: Renaming a zipped file so it works on a PC
  • From: Philip Aker <email@hidden>
  • Date: Fri, 5 Dec 2008 12:46:50 -0800

On 2008-12-05, at 12:22:25, Evan Goldstein wrote:

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.

To check the format of the zip file you can use the shell tool <x-man-page://ditto > to create a zip.
A direct call from Terminal would look something like:


ditto -ck --norsrc '/Users/admin/Desktop/Zip_to_do/MAGMLIDS.txt' '/ Volumes/network005-ftpfilemaker/Users/admin/Desktop/Zip_done/ 12052MAG.ZIP'

There's also the <x-man-page://zip> tool which might offer more compatibility options.


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 network005" 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

Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
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
References: 
 >Renaming a zipped file so it works on a PC (From: "Evan Goldstein" <email@hidden>)

  • Prev by Date: RE: Getting time Stamp from Applescript
  • Next by Date: How to add keywords to photos in iPhoto?
  • Previous by thread: Renaming a zipped file so it works on a PC
  • Next by thread: How to add keywords to photos in iPhoto?
  • Index(es):
    • Date
    • Thread