• 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: guess the file size of compressed file from the original
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guess the file size of compressed file from the original


  • Subject: Re: guess the file size of compressed file from the original
  • From: Graff <email@hidden>
  • Date: Sun, 27 Jun 2004 16:18:58 -0400

On Jun 27, 2004, at 12:24 PM, John W. Baxter wrote:

On 6/26/2004 19:24, "Bill" <email@hidden> wrote:

At this moment, I need to avoid file bigger than 5MB, pick them out by
hand, because my ISP limits each email must be smaller than 5MB.


Keep in mind that a 5meg file encoded for transport via email is larger than
5meg.

Right, so if you have a maximum message size of 5 MB you have to account for the fact that the encoding will increase the file size by about 35%. If you use a file size of around 3.5 MB that will keep well within the message size limit. (3.5 MB * 1.35 = 4.725 MB)

I changed the script a little so that the segment size is 3.5 MB (3584 KB). I'm also adding back in the last line that got removed by accident from my last posting of the script. The script still worked but it didn't clean up a temporary file like it should have.

----
set theFolder to choose folder
set posixFolder to quoted form of POSIX path of theFolder
set theName to name of (info for theFolder)

set tmpFolder to POSIX path of (path to "temp")
set tmpFile to quoted form of (tmpFolder & "tempArchive.dmg")
set dstPath to quoted form of ((POSIX path of (path to desktop folder)) & theName)
do shell script "/usr/bin/hdiutil create -ov -imagekey zlib-level=9 -srcfolder " & posixFolder & " -volname " & quoted form of (theName) & " " & tmpFile
do shell script "/usr/bin/hdiutil segment -o " & dstPath & " -segmentSize 3584k " & tmpFile
do shell script "rm -f " & tmpFile
----

- Ken
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: guess the file size of compressed file from the original (From: "John W. Baxter" <email@hidden>)

  • Prev by Date: Re: iSub Toggle
  • Next by Date: Re: timeout of 0 seconds
  • Previous by thread: Re: guess the file size of compressed file from the original
  • Next by thread: Re: Finder window sidebar
  • Index(es):
    • Date
    • Thread