• 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
Re: Folder Action script runs on file renaming
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder Action script runs on file renaming


  • Subject: Re: Folder Action script runs on file renaming
  • From: Christopher Nebel <email@hidden>
  • Date: Thu, 6 Dec 2007 14:13:59 -0800

On Dec 6, 2007, at 1:21 PM, Rob Lewis wrote:

I have a folder action script that runs when items are added to the folder.

I just discovered that the script also runs when anything already in the folder is renamed. I want to stop this.

The basic rule for folder action scripts is to move the file out of the "hot" folder, if not immediately, then by the time the script finishes. There are two reasons for this. First is the one you've already found -- Folder Actions detects "new" items by name, so a renamed item is considered to be new. Second is that in order to find the new items, it must scan all the items in the folder -- this is a technical limitation of the OS -- which can become a performance problem as items are allowed to pile up into the thousands.


Short version: move first, then rename.


--Chris Nebel AppleScript Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Folder Action script runs on file renaming
      • From: Doug McNutt <email@hidden>
    • Re: Folder Action script runs on file renaming
      • From: "John C. Welch" <email@hidden>
References: 
 >Folder Action script runs on file renaming (From: Rob Lewis <email@hidden>)

  • Prev by Date: Re: Problem with reading 4-byte floats from file on Intel
  • Next by Date: Re: Finder inconsistency (Was: What makes AppleScript difficult)
  • Previous by thread: Folder Action script runs on file renaming
  • Next by thread: Re: Folder Action script runs on file renaming
  • Index(es):
    • Date
    • Thread