Hi Ric, thanks for your assistance. I’m creating an application that will assist us in automating the creation of xml files that we regularly have to create. My app does have over 80 Text fields as I collect 5 different titles, descriptions, etc for 16 different items. The goal of my application is to have anyone (even those unskilled with the xml files) copy and paste titles and descriptions into the UI and then let the computer generate all the necessary versions of files. Being a newbie I’m sure there are ways that I can accomplish some of these tasks a little easier. As far as the number of textfields, once I convert them to applescript variables I put them in List so that I can loop through the xml creation process. Currently I have the program creating all of the necessary versions of the files but would like to add save and open functionality so that someone could reload a previous set of titles and descriptions at a later time.
Here is the actual dump_to_file function that I currently have. If I comment out everything after the 7th set of variabes(sprintCheck7) then it saves a file, if I leave them all in or go any further than 7 it doesn’t create anything and xcode says " {dumpToFile:]: No result was returned from some part of this expression. (error -2763)
on dumpToFile_(sender)
set theFile to choose file name with prompt "Save file as:" default name "untitled.xml"
set theFile to posix path of (theFile as string)
set theRec to {baseName_1: baseName1's stringValue(), title_1 : title1's stringValue(), description_1 : description1's stringValue(), yahooCheck_1: yahooCheck1's state(),sprintCheck_1: sprintCheck1's state(),baseName_2: baseName2's stringValue(), title_2 : title2's stringValue(), description_2 : description2's stringValue(), yahooCheck_2: yahooCheck2's state(),sprintCheck_2: sprintCheck2's state(), baseName_3: baseName3's stringValue(), title_3 : title3's stringValue(), description_3 : description3's stringValue(), yahooCheck_3: yahooCheck3's state(),sprintCheck_3: sprintCheck3's state(),baseName_4: baseName4's stringValue(), title_4 : title4's stringValue(), description_4 : description4's stringValue(), yahooCheck_4: yahooCheck4's state(),sprintCheck_4: sprintCheck4's state(),baseName_5: baseName5's stringValue(), title_5 : title5's stringValue(), description_5 : description5's stringValue(), yahooCheck_5: yahooCheck5's state(),sprintCheck_5: sprintCheck5's state(),baseName_6: baseName6's stringValue(), title_6 : title6's stringValue(), description_6 : description6's stringValue(), yahooCheck_6: yahooCheck6's state(),sprintCheck_6: sprintCheck6's state(),baseName_7: baseName7's stringValue(), title_7 : title7's stringValue(), description_7 : description7's stringValue(), yahooCheck_7: yahooCheck7's state(),sprintCheck_7: sprintCheck7's state(),baseName_8: baseName8's stringValue(), title_8 : title8's stringValue(), description_8 : description8's stringValue(), yahooCheck_8: yahooCheck8's state(),sprintCheck_8: sprintCheck8's state(),baseName_9: baseName9's stringValue(), title_9 : title9's stringValue(), description_9 : description9's stringValue(), yahooCheck_9: yahooCheck9's state(),sprintCheck_9: sprintCheck9's state(),baseName_10: baseName10's stringValue(), title_10 : title10's stringValue(), description_10 : description10's stringValue(), yahooCheck_10: yahooCheck10's state(),sprintCheck_10: sprintCheck10's state(),baseName_11: baseName11's stringValue(), title_11 : title11's stringValue(), description_11 : description11's stringValue(), yahooCheck_11: yahooCheck11's state(),sprintCheck_11: sprintCheck11's state(),baseName_12: baseName12's stringValue(), title_12 : title12's stringValue(), description_12 : description12's stringValue(), yahooCheck_12: yahooCheck12's state(),sprintCheck_12: sprintCheck12's state(),baseName_12: baseName12's stringValue(), title_12 : title12's stringValue(), description_12 : description12's stringValue(), yahooCheck_12: yahooCheck12's state(),sprintCheck_12: sprintCheck12's state(),baseName_14: baseName14's stringValue(), title_14 : title14's stringValue(), description_14 : description14's stringValue(), yahooCheck_14: yahooCheck14's state(),sprintCheck_14: sprintCheck14's state(),baseName_15: baseName15's stringValue(), title_15 : title15's stringValue(), description_15 : description15's stringValue(), yahooCheck_15: yahooCheck15's state(),sprintCheck_15: sprintCheck15's state(),baseName_16: baseName16's stringValue(), title_16 : title16's stringValue(), description_16 : description16's stringValue(), yahooCheck_16: yahooCheck16's state(),sprintCheck_16: sprintCheck16's state()}
set theDic to current application's NSMutableDictionary's dictionaryWithDictionary_(theRec)
theDic's writeToFile_atomically_(theFile,true)
end
Thanks again for any assistance.
Tim