Re: Folder Action Vs Finder
Re: Folder Action Vs Finder
- Subject: Re: Folder Action Vs Finder
- From: Marconi <email@hidden>
- Date: Thu, 12 Sep 2002 11:45:42 -0700
At 8:10 PM +1200 09/12/2002, Andy Wylie wrote:
>
on Wed, 11 Sep 2002 22:04:11 -0700 bill fancher wrote:
>
>
>Did the test. (Used the Apple supplied "add - new item alert" script,
>
>making it even easier than I'd anticipated.) Result: Adding a file with
>
>a duplicate name brings up the finder Replace dialog. The folder action
>
>is not executed.
>
>
>
>Perhaps there should be a "changing items in..." event.
>
>
until then you could check...
>
>
tell application "Finder"
>
set {newFolName, folName, cnt} to {"Test", "Test", 0}
>
set |exists| to (get exists of folder named folName of desktop)
>
repeat until |exists| = false
>
set cnt to cnt + 1
>
set newFolName to folName & cnt
>
set |exists| to (get exists of folder named newFolName of desktop)
>
end repeat
>
set newFolder to (make new folder at desktop with properties
>
{name:newFolName})
>
end tell
>
_____________________________ Andy
Actually, I think it might be easier, for me at least, to place a "contents" folder within the folder assigned the folder action. Then any dropped files could have their names compared to the files in the "contents" folder. If there is no identically named file, just move it to "contents". If there is a file of the same name within "contents", find a name that is not existent (-2, -3, -n) rename the dropped file and then move it to "contents".
_______________________________________________
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.