Folder actions and virex script...
Folder actions and virex script...
- Subject: Folder actions and virex script...
- From: "John C. Welch" <email@hidden>
- Date: Tue, 17 Sep 2002 07:41:27 -0400
Okay, so what I am trying to do is set up a folder action that passes
everything added to the folder through the CLI component of Virex, namely
vscanx, which lives in /usr/local/vscanx/, thereby getting near-autoscans
for downloaded files without Norton's inane insistence on "Kernel Extensions
for EVERYTHING!!!"
I'm basically perverting the "add - new item alert.scpt" for this, to get
the basic shell for the actions.
It reads the incoming files okay, and gets the posix path correctly. I even
have everything quoted correctly so that I don't need to escape spaces, etc.
If I run the command I build manually, it works. If I tell it to output the
results to a text file and run it manually, it works.
If I run it through the repeat loop telling it to run the command, it only
appears to make one iteration and dies. (yes, I know that right now, only
multiple items will work, that's what I'm testing ;-).
Any tips would be helpful, and yes, I did pull the instructions to output
the results to a text file. (It caused an odd single iteration loop, which
while correct is annoying, and as soon as I can, it's going to output to a
dialogue box.)
Code below:
property theScan : "/usr/local/vscanx/vscanx --allole --dam --delete
--one-file-system --recursive --secure --summary "
on adding folder items to this_folder after receiving added_items
tell application "Finder"
set the folder_name to the name of this_folder
end tell
-- find out how many new items have been placed in the folder
set the item_count to the number of items in the added_items
--create the alert string
display dialog item_count
if item_count is greater than 1 then
repeat with x in added_items
set thePath to POSIX path of x
display dialog thePath
set theCommand to "\"" & theScan & thePath & "\"" as string
display dialog theCommand
do shell script theCommand
end repeat
end if
end adding folder items to
--
"Hard pressed on my right. My center is yielding. Impossible to maneuver.
Situation excellent. I am attacking."
- Ferdinand Foch at the Battle of the Marne
_______________________________________________
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.