Re: Porting FolderCount routine to OSX
Re: Porting FolderCount routine to OSX
- Subject: Re: Porting FolderCount routine to OSX
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 04 Dec 2003 18:37:02 -0800
On 12/4/03 5:52 PM, "Jeff Handy" <email@hidden> wrote:
>
This bit of code doesn't seem to work in OSX like it does in OS9. The
>
FolderCount variable doesn't seem to want to set properly. Also, I'm
>
using Script Debugger and the value of "count" is way off. There are
>
only three folders but a value of 28 is showing up. I must be missing
>
something here. Any help appreciated.
>
>
>
Jeff Handy - Sr. Digital Media Specialist
>
Bisk Education - Technology Development Dept.
>
9417 Princess Palm Avenue
>
Tampa, FL 33619
>
email@hidden
>
>
>
>
tell application "Finder"
>
try
>
set the Folder_list to (every folder of the entire
>
contents of folder QTtarget_fldr) as list
>
set the FolderCount to (count of (every folder of the
>
entire contents of folder QTtarget_fldr)) as text
>
end try
>
end tell
>
>
set x to 1
>
>
repeat (FolderCount) times
>
>
--yadda, yadda
>
>
Why would you set something 'as text' and then expect it to still be an
integer that understands 'repeat [text] times' ? Why are you coercing 'as
text' anyway? What's that for? Leave it as an integer.
Also why get (every folder of the entire
contents of folder QTtarget_fldr) twice? It's a slow command. Set a
variable to it the first time and use the variable the second time. And you
don't need 'as list' when it's already a list.
tell application "Finder"
set Folder_list to (every folder of (the entire
contents of folder QTtarget_fldr))
set the FolderCount to (count Folder_list)
end tell
set x to 1
repeat (FolderCount) times
--
Paul Berkowitz
_______________________________________________
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.