Tuesday, September 27, 2022
  • Index
  •  » Code Exchange
  •  » Finder.app: Backup Selection to folder "Backups folder" of desktop

#1 2022-08-14 07:47:59 am

KniazidisR
Member
From:: Greece
Registered: 2019-03-03
Posts: 2524

Finder.app: Backup Selection to folder "Backups folder" of desktop

Applescript:


on backupFinderSelectionToDesktop()
   try
       tell application "Finder" to make new folder at desktop with properties {name:"Backups folder"}
   end try
   set targetFolder to "" & (path to desktop) & "Backups folder:"
   set _date to do shell script "date \"+%Y-%m-%d\""
   try
       tell application "Finder" to set targetFolder to make new folder at folder targetFolder with properties {name:_date}
   on error
       set i to 2
       repeat
           try
               alias (targetFolder & _date & " (" & i & ") ")
               set i to i + 1
           on error
               tell application "Finder" to set targetFolder to ¬
                   make new folder at folder targetFolder with properties {name:(_date & " (" & i & ") ")}
               exit repeat
           end try
       end repeat
   end try
   tell application "Finder" to repeat with finderItem in (get selection)
       duplicate (contents of finderItem) to targetFolder with replacing
   end repeat
end backupFinderSelectionToDesktop

backupFinderSelectionToDesktop()

Last edited by KniazidisR (2022-08-14 08:00:04 am)


Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB

Offline

 
  • Index
  •  » Code Exchange
  •  » Finder.app: Backup Selection to folder "Backups folder" of desktop

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)