Re: Folder Actions
Re: Folder Actions
- Subject: Re: Folder Actions
- From: Olivier Destrebecq <email@hidden>
- Date: Wed, 08 Aug 2001 11:01:41 -0500
Sorry i left some test code in the last posting, that is why you got an
error.
here is a version that works on my computer, let me know if you find
anything to change. the only thing i did not manage to do was set the
position of the pop up, if any body knows how, let me know.
the script also does not check if it is an alias to an application or
anything else, maybe for later...
i added the feature that if you remove an item, it also resize the window.
This might not work the first time you run the script, but should run the
second time
olivier
global moved
on adding folder items to parent_folder after receiving added_items
set moved to true
repeat with CurrentItem in added_items
set CurrentFile to CurrentItem as alias
set bob to get info for (CurrentItem as alias)
if alias of (get info for CurrentFile) is false then
tell application "Finder" to move CurrentItem to desktop
tell application "Finder" to close container window of
parent_folder
else
set moved to false
end if
end repeat
if moved is false then
tell application "Finder"
activate
set popup of container window of parent_folder to false
set Saved_Size to (size of container window of parent_folder)
set Saved_Width to item 1 of Saved_Size
set zoomed of container window of parent_folder to true
set new_Size to size of container window of parent_folder
set new_Height to item 2 of new_Size
set size of container window of parent_folder to {Saved_Width,
new_Height}
set popup of container window of parent_folder to true
close container window of parent_folder
end tell
end if
end adding folder items to
on removing folder items from parent_folder after losing added_items
tell application "Finder"
activate
if moved is false then
set popup of container window of parent_folder to false
set Saved_Size to (size of container window of parent_folder)
set Saved_Width to item 1 of Saved_Size
set zoomed of container window of parent_folder to true
set new_Size to size of container window of parent_folder
set new_Height to item 2 of new_Size
set size of container window of parent_folder to {Saved_Width,
new_Height}
set popup of container window of parent_folder to true
close container window of parent_folder
end if
end tell
set moved to false
end removing folder items from
>
From: Jon Pugh <email@hidden>
>
Date: Wed, 8 Aug 2001 08:25:42 -0700
>
To: Olivier Destrebecq <email@hidden>,
>
<email@hidden>
>
Subject: Re: Folder Actions
>
>
At 10:17 AM -0500 8/8/2001, Olivier Destrebecq wrote:
>
> here is yet a better version.
>
>
This one rejects aliases, but doesn't resize the window properly. I get a
>
-1728 error when dragging an alias to the popup window.
>
>
And I've got to get moving toward work.
>
>
Thanks.
>
>
Jon
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users