MacOS 中是否有熱鍵可以在父資料夾和子資料夾之間上下移動資料夾?
例如,在這個簡單的範例中,我想將檔案 1234.pdf 移至資料夾 A,這將使子資料夾 A 為空。理想情況下,我只需使用鍵盤即可完成此操作。加分點:用於重新選擇上次選擇的子資料夾的熱鍵(以便我可以刪除、重新命名等)。
- Folder A
- Subfolder A
-File 1234.pdf
- Folder B
答案1
對於未能及時回覆您的答复,我深表歉意。這比我預想的更具挑戰性。
但可以透過創造一個來實現你想要的服務在自動機,然後可以透過鍵盤快捷鍵(熱鍵)進行存取。
你需要遵循本指南提供全系統服務。
首先建立一個新服務自動機。它將需要接收文件或資料夾作為輸入,並可在發現者。
添加一個運行AppleScript對工作流程採取的行動。在該操作的文字區域中,可以複製並貼上以下 AppleScript:
use Finder : application "Finder"
property F_ : missing value -- The previous folder
property f : missing value -- The files that we moved
property home : Finder's home as alias
on run {f, _}
get its ParentFolderOf:(some item in f)
set there to the result -- The destination folder, one level up
-- We won't navigate any higher up the folder tree than
-- the home folder
if (its ParentFolderOf:home) is in there then return
-- Also don't apply this service to other folders that aren't
-- in the same branch of the folder tree as the home folder
if (there as text) does not begin with (home as text) then return
-- The folder we're currently at
tell Finder to set F_ to ¬
(the container of some item in f) as alias
-- Check to ensure there are no files in the destination folder
-- that risk being overwritten. If there are, we won't move
-- the files who share the same name, i.e. only move those that
-- are safe to move.
tell Finder to ¬
repeat with _g in f
get name of _g
set g to [there as text, result] as text
if not (g exists) then set end of f to _g
set f to the rest of f
end repeat
-- Move the files
tell Finder ¬
to set f ¬
to (move f to there) ¬
as list as alias list
-- Reveal them
reveal f
activate Finder
end run
to ParentFolderOf:(f as alias)
local f
set F_ to [f, "::"] as text as alias
if (f as text) ends with ":" then return F_
return its ParentFolderOf:F_
end ParentFolderOf:
將服務儲存為您喜歡的任何內容。 自動機自動將其保存在正確的位置(〜/圖書館/服務)。我把我的保存為“在 Finder 中上升”。
接下來,您必須建立鍵盤快捷鍵。這是透過系統偏好設定:
在服務清單下,您需要向下捲動到標記的部分文件和資料夾,其下應顯示您的服務名稱。你可以看到我的突出顯示。我為我的創建了快捷方式⌃▲(Ctrl+向上鍵)。
現在,每次我選擇文件和/或資料夾時發現者然後按⌃▲,這些檔案和資料夾將在層次結構中上升一級,進入其父資料夾。如果我想將它們移回來,我可以按⌘Z撤消該移動。
我設定了保護措施,以便文件和資料夾不會在資料夾樹中移動到比主資料夾更高的位置。無論如何,你不太可能需要這樣做。