• 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 16:51:27 +1000

G'day Joe, and thanks. That might work, I'll test it when I have time.

I think I've narrowed the problem down.

The script opens the mail in TextEdit, copies it to the desktop, then to a folder on the desktop and renames it to an '.rtfd' extension if it doesn't have attachments. Then it copies it to the server. 

This happens fast. I believe the Finder does not update it's data on the file until it needs to get some information on it, and needs two reads to return the size. The  first read only locates the file and updates the finders position of it.

At least I think that's what's happening!   A system events read just might update the data in one go.

Regards

Santa


On 22/07/2010, at 4:17 PM, Joe wrote:

At 11:13 AM +1000 7/22/10, Brian Christmas wrote:
Thanks Ronald, but the statement was already embedded as part of a tell Finder block

The answer is to read twice sequentially, as I found after testing for some time.

set ptd to path to desktop
set ptf to ptd & "2010-06-28 142254Z.rtf" as text
tell application "Finder"
set temp to (file ptf as alias)
set temp2 to properties of temp
set temp2 to properties of temp
set thesize to size of temp2
end tell
temp2

Regards

Santa

Have you tried it in a System Events tell?

tell application "System Events"
set x to physical size of disk item "Disk:Users:User:Desktop:afile"
end tell

Joe

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

  • Prev by Date: Re: AppleScript to move messages between mailboxes in Apple Mail
  • 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