3

私がやろうとしていることは次のとおりです。

x を現在の選択に設定し、選択を次のファイルに進めてから x を削除します。

私がこれを行っているのは、CMD-backspace が毎回選択をクリアし、それが面倒だからです!

4

2 に答える 2

1

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.

Selection

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

Entire folder

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
于 2011-07-27T00:22:58.520 に答える
0

下向き矢印を押してから削除するなど、システムイベントにキーをスクリプト化するように指示できますCommand ⌘</kbd> + delete

于 2009-12-05T21:28:26.750 に答える