tell application "Nisus Writer Pro" to set newRules to the selected text of document 1 set the text item delimiters to every character of " .,:;!?(){}[]#*<>\n\r" set newRules to every text item of newRules set rulesToAdd to "" repeat with newRule in newRules if "-" is in newRule then set rulesToAdd to rulesToAdd & newRule & return end repeat set AppleScript's text item delimiters to {""} if newRules is not "" then set myHyphExcFile to "/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/English-HyphenationExc.txt" set excScript to "echo \"" & rulesToAdd & "\" >> " & myHyphExcFile tell me to do shell script excScript with administrator privileges end if