Create folders from files and move files into created folder

A

adriano31

Neues Mitglied
Thread Starter
Dabei seit
29.06.2016
Beiträge
5
Reaktionspunkte
0
Hey guys,
I have this applescript code that works great, BUT , I need to change some small things like :

- you drag the folder to a dropplet (automator application, applescript app) instead of what is doing now, it asks you to choose the folder.

- change the destination folder to the parent folder from where you drag those files

I can't figure it out how to do all of this, but it's gonna save me a lot of time.
Vielen Dank und tut mir leid fur mein deutsch (


set sourceFolder to (choose folder)

set destinationFolder to "/Users/imaging/Desktop/"


tell application "Finder" to set theFiles to files of sourceFolder

repeat with aFile in theFiles

set Nm to name of aFile

set {TID, text item delimiters} to {text item delimiters, "-"}

set customer to text item 1 of Nm

set text item delimiters to TID

set dest to quoted form of (destinationFolder & customer & "/" & Nm)

do shell script "/bin/mkdir -p " & quoted form of (destinationFolder & customer)

do shell script "/bin/mv " & quoted form of POSIX path of (aFile as text) & space & dest

end repeat
 
Zurück
Oben Unten