Hello I was wondering if anyone could help me with a script I am writing. I have got so far but now have run into a little problem. Right at the beginning of the script, I have added an extra line to copy whatever goes into “selectedFilepaths” out to the end of list “joblist”. Then further down “joblist” is copied to “finishedFilepaths” and then this is the list the find and replace code runs on, only the code dosn’t work when it is running on the copied list. It works great on selectedFilepaths copied to finishedFilepaths but not when selectedFilepaths has been copied to joblist. Arghhh, as you have probably guessed I am new AppleScript and am not terribly good but I want to persevere as I can see it has loads of potential. If anyone has any suggestions I would be extremly grateful
Cheers
set selectedFilepaths to dragInfoPasteboard
copy selectedFilepaths to end of jobList
if (count of selectedFilepaths) > 0 then
set tids to AppleScript's text item delimiters
set AppleScript's text item delimiters to "/"
-- to get the single file name--
set singleFiles to {}
copy selectedFilepaths to toSingleout
repeat with x from 1 to toSingleout's length
set y to toSingleout's item x
set end of singleFiles to text item -1 of y
display dialog "I am moving " & singleFiles
end repeat
-- to get the single file name--
set AppleScript's text item delimiters to tids
end if
copy jobList to finishedFilepaths
set toBeReplaced to “Volumes”
set correctBeginning to “RAID/Data”
→ {“/RAID/Data/SHARE/Artwork/extra_special.jpg”, “/RAID/Data/SHARE/Artwork/james.jpg”}
set tids to AppleScript’s text item delimiters – save
repeat with i from 1 to finishedFilepaths’s length
set s to finishedFilepaths's item i
set AppleScript's text item delimiters to toBeReplaced
set s to s's text items
set AppleScript's text item delimiters to correctBeginning
set s to s as string
set finishedFilepaths's item i to s
end repeat
set AppleScript’s text item delimiters to tids
set remoteLogin to “rsh -l XXXX XX.XX.X.XXX cp -p "
set destinationDir to " /RAID/Data/Clients_ODIN/XX/James/Testing/out”
repeat with i from 1 to finishedFilepaths’s length
set toCopy to finishedFilepaths's item i
do shell script remoteLogin & toCopy & destinationDir