I’m a total novice at applescript and am trying to make a script to ask the user what he wants to name a folder and certain files inside that folder. Let’s say I have a parent folder called “FirstLast” and inside it is 7 files, some with names like “FirstLast_RAW” and “FirstLast_burn” (the other items inside the folder are other folders and files without “FirstLast” in their filenames). So the script should:
Ask the user for the artist’s name
Rename the parent folder from “FirstLast” to [new_name]
Replace text of filenames inside the parent folder that contains “FirstLast” to [new_name]
set art_name to text returned of (display dialog " Add Artists Name:" default answer "")
set t to choose folder
tell application "Finder"
set name of t to art_name
set l to items of entire contents of t whose name contains "FirstLast"
repeat with k in l
set k to k as alias
set theText to name of item k
set OldDelims to AppleScript's AppleScript's text item delimiters
set AppleScript's AppleScript's text item delimiters to "FirstLast"
set newText to text items of theText
set AppleScript's AppleScript's text item delimiters to art_name
set newText to newText as text
set AppleScript's AppleScript's text item delimiters to OldDelims
set name of item k to newText
end repeat
end tell