set additions to "" set finished to false repeat until finished is true display dialog ¬ "Enter the next word to add to the user dictionary." & return & ¬ "Press the Finished button when you're finished" with title ¬ "Add words to spelling dictionary" default answer ¬ "" buttons {"Cancel", "Finished", "Add word"} default button 3 if button returned of the result is "Finished" then exit repeat elseset additions to ¬ (additions & the text returned of the result as text) ¬ & (ASCII character 0) end if end repeat set UserFile to choose file with prompt ¬ "Please choose the dictionary file to add the words to." default location ¬ alias ((path to library folder from user domain as text) & "spelling") set fileRef to open for access UserFile with write permission set starting_point to (get eof of fileRef) + 1 write additions to fileRef starting at starting_point close access fileRef