|
|
#1 |
|
Triple-A Player
Join Date: Apr 2008
Posts: 62
|
Folder action sometimes works
I've made a little folder action script, which takes a received file and puts it in a subfolder representing the current month. It usually works, although the time it takes to react varies from virtually instant to upwards of ten seconds, but sometimes it doesn't work at all. Particularly when I drop several items at once, it might only move some of them. It doesn't seem to depend on the files - the same files might work or not work.
Is this a common problem somehow? Could I improve my script to prevent it? I'm using OS 10.7.3, but I've experienced it with similar scripts on previous versions too (10.4, I think). Script follows: Code:
on adding folder items to this_folder after receiving these_items
tell application "Finder"
set themonth to ((month of (current date)) * 1)
set themonth to text -2 thru -1 of ("00" & themonth)
set thename to "" & (year of (current date)) & "-" & themonth
if not (exists folder thename of this_folder) then
make new folder at this_folder with properties {name:thename}
end if
set thetarget to folder thename of this_folder
move these_items to thetarget
end tell
end adding folder items to
|
|
|
|
|
|
#2 |
|
Major Leaguer
Join Date: Apr 2010
Posts: 330
|
Not to dissuade you, but I have never had success with folder actions working consistently. It's on one of the reasons I love, use, and tout Hazel.
__________________
see a problem; solve a problem. |
|
|
|
|
|
#3 |
|
League Commissioner
Join Date: Aug 2006
Posts: 5,040
|
There have been posts here before about editing the launchd script that FolderAction uses to adjust the "respawn throttle" down from 10 to 2 seconds.
I can't remember the exact details, but I did it ages ago and it did improve things, though I do still find that Folder Actions occasionally doesn't wake. But it's much better than it was. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|