I’ve been working on a new app, but it took a different direction to what I originally envisaged, and now i’m running into some problems. I originally chose a document based Applescript app, since it seemed like a good idea for what I had planned. As the development of the app progressed, I realised that I didn’t need a document based app to acomplish what I wanted to. Now, though, I’m left with some of the side effects of a document based app and I’m not sure how to deal with them I’m wondering if th extra funtionality that a document based app provides can be sidestepped. I’m too far gone to start afresh without significant headaches.
When the app opens, the window is always called “Untitled”. I can save it, and then the title of the window becomes whatever the file was saved as. Now, I don’t want to be able to save it, and want the window title to always be “Application Name”, rather than “Untitled”. Is there any way I can force the window title, and preferably remove entirely the option to open or save?
I put a text field into the window. When I edit that text field and then go to close the app it offers me the opportunity to save. Again, is there a way to disable the attempt to save?
I’m sure further consequences of my misguided choice will come back to haunt me, but these are the ones that are annoying me right now
Have you tried starting a new project and creating a new user interface non-document based and then copying the mainmenu.nib over to your existing project folder. I’ve copied nib files to different projects before but I’ve never tried to replace a document based one with an application based one. I’m not even sure if that information is stored in the nib file.
you could for example stop your app from opening an ‘Untitled’ window at startup - simply add an ‘on should open untitled theObject’-Handler for your Document window and return ‘false’.
or
I am not 100% sure about this: you could try to remove the key ‘CFBundleDocumentTypes’ from you project’s ‘info.plist’. This might completely disable the document functionality. (If you don’t want to remove it, you can try it with commenting it out: ( ).
Thanks for the suggestions! Sorry about taking so long to come back to this thread, but my computer has been with Apple for the past few weeks! I’ll have a try at these suggestions and post how I get on!