私がやろうとしていることは次のとおりです。
x を現在の選択に設定し、選択を次のファイルに進めてから x を削除します。
私がこれを行っているのは、CMD-backspace が毎回選択をクリアし、それが面倒だからです!
私がやろうとしていることは次のとおりです。
x を現在の選択に設定し、選択を次のファイルに進めてから x を削除します。
私がこれを行っているのは、CMD-backspace が毎回選択をクリアし、それが面倒だからです!
I'm a bit confused. When you say 'next file' are you referring to the next file in the selection, or the next file in the whole folder? I'll give you both.
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
tell application "Finder"
set these_windows to (get every window) as list
if these_windows is {} then --no windows are open, refer to the desktop
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 --a window is open
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
下向き矢印を押してから削除するなど、システムイベントにキーをスクリプト化するように指示できますCommand ⌘</kbd> + delete