Re: Putting file counts into comments
Re: Putting file counts into comments
- Subject: Re: Putting file counts into comments
- From: Andrew Oliver <email@hidden>
- Date: Tue, 20 Apr 2004 15:38:21 -0700
I'm surprised you even get 6.
One obvious (or not, as the case may be) problem is the line:
>
count files in the_folder
where:
>
set the_folder to the name of this_folder
In other words, 'the_folder' is a string representing the name of the
folder. I am very surprised there are 6 files in a string.
Try being more specific:
set file_count to (count files in folder this_folder)
Then you can do away with the line 'set the_folder to the name of
this_folder ' since it isn't needed.
Andrew
:)
On 4/20/04 3:21 PM, "Michael Vogt" <email@hidden> wrote:
>
I'm attempting to put a file count into the comments of a folder. The
>
script will run when any new items are added to the folder, so I want
>
to make this a folder action. The script runs, but only counts to 6,
>
despite there being more than 500 files in my test folder. Script
>
follows:
>
>
on adding folder items to this_folder after receiving added_items
>
tell application "Finder"
>
set the_folder to the name of this_folder -- I got nothing using
>
this_folder
>
count files in the_folder -- only counts to 6, although there are
>
500+ files in test folder.
>
set file_count to result
>
display dialog file_count -- displays 6
>
if comment of the_folder contains "/" then -- some folders have a
>
date as part of their comments. Don't want to lose that.
>
set comment of the_folder to comment + " " + file_count
>
else
>
set comment of the_folder to file_count
>
end if
>
end tell
>
beep 2
>
end adding folder items to
>
>
Any ideas would be welcome.
>
>
>
There are only 10 type of people in the world, those that understand
>
binary, and those that don't.
>
_______________________________________________
>
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.
_______________________________________________
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.