script Uname_Setup to switchText from t to r instead of s set d to text item delimiters set text item delimiters to s set t to t's text items set text item delimiters to r tell t to set t to item 1 & ({""} & rest) set text item delimiters to d t end switchText to convertText(t, s, r) set d to text item delimiters considering case set t to switchText of t from t to r instead of s end considering set text item delimiters to d t end convertText (* get the current user and change the permissions on the files to be moved*) set theuser to do shell script "whoami" as text (*move the settings file over*) do shell script "cp -rf ~/Desktop/ThunderbirdMac/Thunderbird ~/Library/" (*get current user name and setup work directory*) set workFolder to "Users:" & theuser & ":Library:Thunderbird:Profiles:washcoll.default:prefs.js" as string (* get user id and full name from user*) set userId to text returned of (display dialog ("Please enter your Net ID:" & return & return) default answer "jdoe2" with icon 1) set full_name to text returned of (display dialog ("Please enter your full name:" & return & return) default answer "John Doe" with icon 1) (* stage 1: import old text or open *) set currFile to workFolder as Unicode text set openFile to open for access currFile with write permission set oldText to read openFile (* stage 2: convert text and change *) set newText to convertText(oldText, "USER_ID", userId) (* stage 3: export new text close file*) set eof openFile to 0 (* delete old text *) write newText to openFile close access openFile (* stage 4: reopen file for next value old text *) set currFile to workFolder as Unicode text set openFile to open for access currFile with write permission set oldText to read openFile (* stage 5 take 2 *) set newText to convertText(oldText, "FULL_NAME", full_name) (* stage 6: export new text for a final time*) set eof openFile to 0 (* delete old text *) write newText to openFile close access openFile end script run Uname_Setup