• 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: File size problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File size problem


  • Subject: Re: File size problem
  • From: Brian Christmas <email@hidden>
  • Date: Thu, 22 Jul 2010 20:12:11 +1000

G'day Steve

I've tried your routine, but it crashes.

Part of the POSIX path is 'Mail Manager Folder/RTF Documents', and your script crashes with the error 'mdls could not find "xxx/xxx/xxx/Mail."', where xxx is parts of the path

Obviously mdls can't cope with spaces in the path name.

Regards

Santa


On 22/07/2010, at 6:03 PM, Steve Thompson wrote:


On 21 Jul 2010, at 17:02, Brian Christmas wrote:



problem with getting file sizes in Applescript,

set theFile to "/Users/steve/testfile.csv"
set theSize to last word of (do shell script ("mdls -name kMDItemFSSize " & theFile)) as number

Returns:

tell current application
do shell script "mdls -name kMDItemFSSize /Users/steve/testfile.csv"
--> "kMDItemFSSize = 143"
end tell

Result:

143

And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo





 _______________________________________________
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: 
 >File size problem (From: Brian Christmas <email@hidden>)
 >Re: File size problem (From: Steve Thompson <email@hidden>)

  • Prev by Date: Re: Sort Array by Column X
  • Next by Date: Re: File size problem
  • Previous by thread: Re: File size problem
  • Next by thread: Re: File size problem
  • Index(es):
    • Date
    • Thread