I am a bit confused. When you say "next file", do you mean the next file in the list or the next file in the entire folder? I will give both of you.
The choice
tell application "Finder"
set x to (get the selection) as list
repeat with i from 1 to the count of x
set this_item to item i of x
delete this_item
end repeat
end tell
Whole folder
tell application "Finder"
set these_windows to (get every window) as list
if these_windows is {} then
set these_items to (get every item of desktop) as list
repeat with i from 1 to the count of these_items
set this_item to item i of these_items
delete this_item
end repeat
else
set this_folder to the target of window 1
set these_items to the (entire contents of this_folder) as list
repeat with i from 1 to the count of these_items
set this_item to item i of these_items
delete this_item
end repeat
end if
end tell
source
share