Hello Guys,
I’m a Computer Graphic Artist whit a bit of knowledge on Applescript but needs HELP…
I work with people who does not understand the rules about keeping a server in order…
I’m trying to clean many file names in the server in one shot, Long story… but SHORT
Here’s what I have in a folder :
aCt_train.flow“freight.jpd
aCt-TRAIN…flow“-freight.txt
Art.Jugling -RePt_jo(34).low.jpg
ART-“jugling _ rept&jo_34_low.mp4
Art“jugling rept–jo 34_low.jpg
Spo.magic–ball playoff.jpg
sPO_-MAgic BALL-(playoff).txt
Here’s what I need it in the folder :
ACT-train flow freight.jpd
ACT-train flow freight.txt
ART-jugling rept jo 34 low.jpg
ART-jugling rept jo 34 low.mp4
ART-jugling rept jo 34 low.txt
SPO-magic ball playoff.jpg
SPO-magic ball playoff.txt
I’ve managed to remove all the extra spaces
I’ve managed to replace the 4th character for a single simple dash
I’ve managed to remove all the characters ““_-” exept the “()” “.” “&” or any other strange symbols
I can’t…
…get rid of the periods I need to remove from the name file BUT NOT the extention one
When I add the “.” or the “()” or the “&” in my script, it blocks my script
"“error “Finder got an error: The operation can’t be completed because there is already an item with that name.””
…get the 3 first characters to be in CAP. (Uppercase) AND get the rest of it in lower case
Heres what I got for so far…
set x to choose folder
tell application "Finder"
set y to every file of x as alias list
repeat with i from 1 to number of items of y
set thename to name of item i of y
set theCommand to " | sed 's/[“_-]/\\ /g' | sed 's/ */\\ /g' | sed 's/^\\(.\\{3\\}\\) /\\1-/'"
set z to do shell script "echo " & thename & theCommand
set name of item i of x to z
end repeat
end tell
If any thing to Add or Sub or Change in my script will help please…
Can any one help me please…
Thank you in advance