Hi,
I want to remove all the line breaks from many files with TextWrangler.
I tried with the next script but doesn’t work.
tell application "TextWrangler"
activate
repeat with aFile in filesArray
set docName to name of (open aFile)
tell document docName
-- Set the document text to just the lines which need to be kept.
set its text to copied lines of (process lines containing matching string "(</id>|<name>|</name>)" with matching with grep)
-- Remove line breaks
remove line breaks text of text document
-- Save and close the document.
close saving yes
-- Ensure the document's gone before opening another.
repeat while (it exists)
delay 0.2
end repeat
end tell
end repeat
end tell
Appreciate any help. Thank you in advance.
Model: mac mini 2011
AppleScript: 2.6.1
Browser: Safari 537.36
Operating System: Mac OS X (10.9)