• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Putting file counts into comments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Putting file counts into comments


  • Subject: Putting file counts into comments
  • From: Michael Vogt <email@hidden>
  • Date: Tue, 20 Apr 2004 17:21:02 -0500

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.


  • Follow-Ups:
    • Re: Putting file counts into comments
      • From: Gnarlodious <email@hidden>
    • Re: Putting file counts into comments
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: Re: Filter reference form question
  • Next by Date: Re: Putting file counts into comments
  • Previous by thread: Re: multi-dimensional arrays (new to AS)
  • Next by thread: Re: Putting file counts into comments
  • Index(es):
    • Date
    • Thread