Re: Renamer script
Re: Renamer script
- Subject: Re: Renamer script
- From: Yvan KOENIG <email@hidden>
- Date: Fri, 08 Jan 2016 14:59:41 +0100
Le 2016/01/08 à 08:45, CafeTran Wiki < email@hidden> a écrit :
Hello,
I have a folder with 450 subfolders each containing one or more PNG files:
base\AA\1.png base\AA\2.png base\AA\3.png base\AB\1.png base\AB\2.png base\AB\3.png
I want to rename the PNG files by adding the subfolder (plus a dash) to the file name:
base\AA\AA-1.png base\AA\AA-2.png base\AA\AA-3.png base\AB\AB-1.png base\AB\AB-2.png base\AB\AB-3.png
Can someone point me to either a software program that can do this task or help me with a script?
Thank you!
Hans
Maybe this code may help.
set mainFolder to (path to desktop as text) & "4see:" tell application "System Events" to tell folder mainFolder set theSubFolders to folders repeat with aSubFolder in theSubFolders set itsName to name of aSubFolder tell aSubFolder set theNames to (name of every file whose visible is true) repeat with aName in theNames set name of file (aName as text) to itsName & "-" & aName end repeat end tell end repeat end tell
Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) vendredi 8 janvier 2016 14:59:23
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden