Re: Handler joy
Re: Handler joy
- Subject: Re: Handler joy
- From: Paul Skinner <email@hidden>
- Date: Wed, 28 Feb 2001 13:05:34 -0500
on 2/28/01 11:37 AM, JollyRoger wrote:
>
on 2/28/2001 4:35 AM, Cal at email@hidden wrote:
>
>
> Jolly Roger <email@hidden> replied:
>
>
>
>> Not sure. This works fine for me:
>
>>
>
>> -- begin script
>
>> property ProcessedFolder : "Mac HD:"
>
>>
>
>> return my CheckProcessed(ProcessedFolder)
>
>>
>
>> -- get the number of items of ProcessedFolder
>
>>
>
>> on CheckProcessed(pFolder)
>
>> get the number of items of pFolder
>
>> end CheckProcessed
>
>> -- end script
>
>
>
> Not really, Roger. (Actually, it depends on your definition of
>
> "works fine". If you mean, "it runs and gives me some sort of
>
> answer" then yes. But if you mean "it runs and gives the number of
>
> items in a folder, then no.)
>
>
Cal,
>
>
It gives me the number of items in the folder. I ran it from within Smile -
>
think that makes a difference? Hmm, no, I just ran it from within Script
>
Editor and it worked there too. So why is it working for me, but not for
>
you guys?
>
>
JR
It certainly won't work here. Even with sigma's coercions installed.
It diligently returns the number of text items in the property
ProcessedFolder.
Perhaps, JR, you have the same number of items in that folder as letters
in that file reference? Try moding the number of items in there and re-run
it.
This works here.(OS 9.1/AS 1.5.5)
-- begin script
property ProcessedFolder : "dark star:Desktop Folder:untitled folder:"
return my CheckProcessed(ProcessedFolder)
-- get the number of items of ProcessedFolder
on CheckProcessed(pFolder)
tell application "Finder"
--without this Finder tell I get an error stating...
--'can't get every item of alias blahblah'
--when I coerce the ref to an alias
get the number of items of (pFolder as alias)
--and if I don't coerce this to an alias it's just text which
--means the number of text items is returned.
end tell
end CheckProcessed
-- end script
--
Paul Skinner