Re: count files in folder (MacOS X)
Re: count files in folder (MacOS X)
- Subject: Re: count files in folder (MacOS X)
- From: Andy Wylie <email@hidden>
- Date: Sat, 13 Apr 2002 12:26:04 +1200
on 12/4/02 8:32 PM, email@hidden at email@hidden
wrote:
>
I am curious why some code that works fine in MacOS 9 does not work in
>
MacOS X.
>
>
copy "Macintosh HD:test:" as text to the_vol
>
>
set countfolder to alias (the_vol & "files_in:")
>
set foldercount to the count of every item of countfolder
>
repeat with myfilename in every item in countfolder
>
if foldercount > 0 then
>
beep
>
end if
>
end repeat
>
>
This code works very well in MacOS 9 but gives errors in MacOS X.
>
what I basically want to do is to count files in a folder, if there is no
>
files the script should stop. If any files is found, the script should
>
continue.
>
>
Any ideas on how to do this in MacOS X?
I think Finder is required anywhere, try...
----------------
set the_vol to "Macintosh HD:test:"
set countfolder to (the_vol & "files_in:") as alias
tell application "Finder"
repeat with myfilename in (every item in countfolder)
beep
end repeat
end tell
----------------
do you really have a folder named "files_in:" ?
_____________________________ Andy
_______________________________________________
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.