Re: Folder Actions Help
Re: Folder Actions Help
- Subject: Re: Folder Actions Help
- From: John Delacour <email@hidden>
- Date: Thu, 10 Apr 2003 00:30:56 +0100
- Mac-eudora-version: 6.0a14
At 8:31 am -0700 9/4/03, Jim Heissenbuttel wrote:
...Here is what I have so far:
------snip-------
on adding folder items to this_folder after receiving these_items
set these_items to these_items as list
repeat with i from 1 to count these_items
set itemPath to (item i of these_items as string)
openFile()
processDocument()
closeFile()
end repeat
end adding folder items to
------snip-------
The result is that the first document gets opened, processed, and closed
like expected. Then the second document opens and the script seems to stop.
Can anyone provide an idea why?
No idea. You can run this script exactly as it is. The script will
create a folder and attach a script to it. The finder will reveal
the newly created folder.
Drop items into the folder and you will get a list of every item dropped.
set folder_name to "live_folder"
set folder_path to "" & (path to "cusr") & folder_name & ":"
set unix_folder_path to POSIX path of folder_path
try
alias folder_path
on error
tell application "Finder"
make folder at (path to "cusr") with properties {name:folder_name}
end tell
end try
"" & (path to Folder Action scripts folder from user domain)
set user_FA_folder to the result
set script_path to user_FA_folder & "live_folder.scpt"
set unix_script_path to quoted form of POSIX path of script_path
set folder_script to quoted form of getScript()
do shell script"osacompile -e " &folder_script& " -o " &unix_script_path
set f to alias folder_path
set s to alias script_path
tell application "System Events"
set folder actions enabled to true
attach action to f using s
end tell
tell app "Finder"
activate
reveal alias folder_path
end
------
on getScript()
"on adding folder items to this_folder after receiving list_
set list_ to list_ as list
set ls to {}
set my text item delimiters to \":\"
repeat with file_ in list_
set end of ls to last text item of (\"\" & file_)
end repeat
tell app \"Finder\" to choose from list ls with prompt \"Added:\"
end adding folder items to
"
end
_______________________________________________
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.