I apologizes but I didn’t became a sooth sayer since my late message.
What is the variable ClientDestinationFolderString supposed to contain ?
Is it the path to the folder created by the instruction:
make new folder at end of folder CurrentDir with properties {name:fullName}
I wish to add some comments about the block of instructions:
set ClientNamePrompt to text returned of (display dialog "Please enter your Clients Business Name:" default answer "" buttons {"Cancel", "Create"} default button "Create" cancel button "Cancel") --> "the theorem of : ƒPythagoras # / the €"
set CapitalizedText to ((current application's NSString's stringWithString:ClientNamePrompt)'s capitalizedString()) as string--> "THE THEOREM OF : ƒPYTHAGORAS # / THE €"
--> Word Exraction
set allWords to words of CapitalizedText --> {"THE", "THEOREM", "OF", "ƒPYTHAGORAS", "THE", "€"}
set someWords to {}
set otherWords to {}
repeat with aWord in allWords
set aWord to aWord as string
if not aWord is "The" then set end of someWords to aWord
if aWord is "The" then set end of otherWords to aWord
end repeat
someWords --> {"THEOREM", "OF", "ƒPYTHAGORAS", "€"}
otherWords --> {"THE", "THE"}
set someText to my recolle(someWords, space) --> "THEOREM OF ƒPYTHAGORAS €"
set otherText to my recolle(otherWords, space) --> "THE THE"
set other to someText --> "THEOREM OF ƒPYTHAGORAS €"
set theText to otherText --> "THE THE"
set combined to other & ", " & thetext --> "THEOREM OF ƒPYTHAGORAS €, THE THE"
At this time, if ClientNamePrompt contain several times the word “The”,
combined will contain several times the word “THE”.
Is it really useful ?
If it’s not the block may be replaced by:
set ClientNamePrompt to text returned of (display dialog "Please enter your Clients Business Name:" default answer "" buttons {"Cancel", "Create"} default button "Create" cancel button "Cancel") --> "the theorem of : ƒPythagoras # / the €"
set CapitalizedText to ((current application's NSString's stringWithString:ClientNamePrompt)'s capitalizedString()) as string --> "THE THEOREM OF : ƒPYTHAGORAS # / THE €"
--> Word Exraction
set allWords to words of CapitalizedText --> {"THE", "THEOREM", "OF", "ƒPYTHAGORAS", "THE", "€"}
set someWords to {}
set theText to ""
repeat with aWord in allWords
set aWord to aWord as string
if aWord is "THE" then
set theText to aWord
else
set end of someWords to aWord
end if
end repeat
someWords --> {"THEOREM", "OF", "ƒPYTHAGORAS", "€"}
set combined to my recolle(someWords, space) --> "THEOREM OF ƒPYTHAGORAS €"
if theText ≠ "" then set combined to combined & ", " & theText --> "THEOREM OF ƒPYTHAGORAS €, THE"
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mardi 23 juin 2020 19:33:33