使用Finder时,脚本可能会占用大量时间。我也希望这个脚本在后台运行。如何在此脚本中使用System Events / bash而不是Finder?
property source_folder_one : alias "OS X:Users:username:Pictures:Work:New:one"
property source_folder_two : alias "OS X:Users:username:Pictures:Work:New:two"
property save_folder_one : alias "OS X:Users:username:Pictures:Work:Waitlist:one"
property save_folder_two : alias "OS X:Users:username:Pictures:Work:Waitlist:two"
tell application "Finder"
move entire contents of folder source_folder_one to folder save_folder_one
move entire contents of folder source_folder_two to folder save_folder_two
end tell
display notification "All images were relocated." with title "Relocating Complete" sound name "Glass.aiff"
tell me to quit
答案 0 :(得分:0)
我做了一个可以做你想要的苹果。 但是对于一个文件夹而不是两个文件夹,您可以在提示中选择该文件夹。
set sourceFolder to (choose folder) as alias
set saveFolder to (choose folder) as alias
set sourceFolderPOSIXPath to (the POSIX path of sourceFolder)
set saveFolderPOSIXPath to (the POSIX path of saveFolder)
set shellString to "mv " & sourceFolderPOSIXPath & "* " & saveFolderPOSIXPath
do shell script shellString
display notification "All files were relocated." with title "Relocating Complete" sound name "Glass.aiff"
如果您想使用常量别名,只需将(choose folder)
替换为"OS X:Users:username:Pictures:Work:New:one"
,依此类推。