Re: physical size error
Re: physical size error
- Subject: Re: physical size error
- From: "Stockly, Ed" <email@hidden>
- Date: Thu, 30 Sep 2010 14:20:40 -0500
- Acceptlanguage: en-US
- Thread-topic: physical size error
Title: Re: physical size error
Is this finder or system events?
This rang a bell for me so I looked into a couple handlers and found this:
tell application "Finder"
update imageFile
set imageSize to physical size of imageFile
end tell
I’m betting that System Events would be more reliable.
HTH,
ES
On 9/30/10 11:12 AM, "Luther Fuller" <email@hidden> wrote:
I wrote a script which has a strange behavior: It errors on the first use after a restart.
I traced the error to this one line ...
set fileSize to (physical size of fileAlias) -- = 'missing value' on first run after restart
If I try to run the script a second time, it works perfectly.
I eliminated the problem by replacing the line with this code ...
repeat
try
0 + (physical size of fileAlias) -- = 'missing value' on first run after restart
set fileSize to the result
exit repeat
on error
delay 1
end try
end repeat
Does anyone have an explanation?
_______________________________________________
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