-- fix last input for Colloquy -- edited to also map a local ip to external domain name by 31d1 property lastLineWritten : missing value property version : 0.2 using terms from application "Colloquy" -- replace internal ip with external on process outgoing chat message m if body of m contains "192.168.1.50" then set reg to "s/192.168.1.50/plu.gs:4/g" set fixedLineText to replaceTextWithRegex(reg, body of m) set HTML of m to fixedLineText end if -- replace text in last line using regex if body of m starts with "s/" then set fixedLineText to replaceTextWithRegex(body of m, lastLineWritten) set lastLineWritten to fixedLineText set HTML of m to fixedLineText else set lastLineWritten to body of m end if end process outgoing chat message end using terms from on replaceTextWithRegex(theRegex, theText) if length of theText = 0 then return "" end if set cmdLine to "echo \"" & theText & "\" | /usr/bin/perl -e '($s=<>)=~" & theRegex & ";print $s'" set results to do shell script cmdLine end replaceTextWithRegex