Document based app confusion

Hey all

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 :stuck_out_tongue: 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.

  1. 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?

  2. 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 :smiley:

Thanks for any help you can offer!

No ideas for this one? Any help would be much appreciated!

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.

Hi Castle,

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: ( ).

Hope that helps …

D.

Castle, your best bet at this point is to do the following:

  1. if you have anything in your Document.nib, move it to the MainMenu.nib using a copy and paste;
  2. Same goes for Document.applescript - move to the main application script;
  3. reconnect all the handlers and make sure it all works;
    4 then create a new project, non-document handling;
  4. close the new project in Xcode, then copy the MainMenu.nib from the old project to the new one;
  5. reopen the project, then open the OLD application script, copy the contents, and paste into the new script.

At this point you should have all the “pieces” put back together. I’ve done similar in the past, it is a pain, but it works.

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!