• 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
Folder actions - interesting behaviour depending on how items are added to the folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Folder actions - interesting behaviour depending on how items are added to the folder


  • Subject: Folder actions - interesting behaviour depending on how items are added to the folder
  • From: Alex Zavatone <email@hidden>
  • Date: Tue, 17 Jul 2012 14:00:44 -0400

System 10.6.8

I've been interested in certain folder actions for a long time, where dropping items in a folder would perform a service type operation.

I just had the need to zip a bunch of individual files, so thought it would be a perfect time to set up some folder actions to do this when the files are added to the folder.

Upon the start of the operation, I logged a "starting operation" and at the end, a "task complete", so I could monitor if this always worked from the console.

Well, it appears that it doesn't.

It appears that folder actions do not register that files have been added if the items being added are being copied from another server volume to the folder they are attached to.

Has anyone else seen this?  

The same files work fine when placed into the folder with the folder action if they are copied or dragged form a local volume.

This is the script that I am using from MacScripter.net.  It zips files that are dropped into the folder:

on adding folder items to FilestoZip after receiving droppedFiles


log ("Autozip: task started.")


repeat with aFiletoZip in droppedFiles


tell application "Finder"
set theItem to aFiletoZip as alias
set itemPath to quoted form of POSIX path of theItem
set fileName to name of theItem
if fileName does not end with "zip" then --this line fixed the problem
set theFolder to POSIX path of (container of theItem as alias)
set zipFile to quoted form of (theFolder & fileName & ".zip")
do shell script "zip -r -j " & zipFile & " " & itemPath
end if
end tell
log ("Autozip: " & fileName & " zipped.")
end repeat


log ("Autozip: task complete.")


end adding folder items to


 _______________________________________________
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 actions - interesting behaviour depending on how items are added to the folder
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Display dialog to a remote machine via EPPC
  • Next by Date: Re: Display dialog to a remote machine via EPPC
  • Previous by thread: [ANN] Macs in Chemistry Applescripts Updated
  • Next by thread: Re: Folder actions - interesting behaviour depending on how items are added to the folder
  • Index(es):
    • Date
    • Thread