on run
try
set theText to (the clipboard as text)
--on error
(*if my parleAnglais() then
error "No valid text data in the Clipboard !"
else
error "Pas de données texte dans le presse-papiers !"
end if*)
end try
set twoSpaces to space & space
set threeSpaces to twoSpaces & space
repeat while theText contains threeSpaces
set theText to my remplace(theText, threeSpaces, twoSpaces)
end repeat
set the clipboard to my remplace(theText, twoSpaces, ",")
end run
--=====
on remplace(t, d1, d2)
local l
set AppleScript's text item delimiters to d1
set l to text items of t
set AppleScript's text item delimiters to d2
set t to l as text
set AppleScript's text item delimiters to ""
return t
end remplace
That I copied from the scripture website. I want to put this in a workflow to remove all the double and greater spaces with a comma. Then put them in a excel spread sheet to sort the list. So far I have a workflow that takes the current web page from safari and copies the text from the web page and passes it on to the applescript. Apparently I cannot do two ‘on’ statements in the same script. I have no idea how to get around that. Any help would be appreciated.
Sincerely,
Hendrik W. M. van Eeden