I have a watchpath folder in launchd plist, how can i send detected item to an applescript?
Thanks
I have a watchpath folder in launchd plist, how can i send detected item to an applescript?
Thanks
Hi,
launchd notifies that the content of the folder has changed, not what has changed.
You could use a property to save the last state of the folder (a list of file names) and compare the current state after launchd has notified
i understand… some guide or example to save the last state of the folder and compare the current state. I need save last state in a file for compare?.
I know save with automator filenames of files modified today in a variable to use in applescript…
but i dont know how save parameters of those files to compare file by file, and dont know how compare it and return the filenames of diferents files
:rolleyes: an applescripter novice…
with this http://mac.softpedia.com/progDownload/Save-File-List-Download-68429.html maybe i could save the list of files into a file to compare…but i think that i would save files with their parameters (modification date)
Thanks
I see your a novice… so you have to think about the actual steps you would have to perform. Then learn how to do each step. Then put the steps together in one workflow. For your example you need to know…
I’ll get you started with the first step. You can do some searching and learning for the other steps.
set theFolder to choose folder
tell application "Finder"
set fileNameList to name of every item of theFolder
end tell
I just noticed StefanK suggested using a “property” instead of a file as I suggested to save the file names between launches of the script. That’s even easier but again just think about the steps, learn them, and put it together. That’s the basic programming concept for any language. Then when you have a question you can ask about a single step rather than hoping somebody will write a full script for you.