Name change on a Project

Can anyone tell me how to change the name of an application project. I’ve tried changing the names of all the elements in the project that I could find, from the applescript file all the way down to the info.plist. When I change the names the application no longer works when launched. There must be an easy method for changing the name of the application and the project. Any help would be appreciated.

Sorry. To the best of my knowledge once it’s done… it’s done. :cry: There was a post about this here at one point, but it appears to have disappeared. There simply are too many references made behind the scenes to simply change the name in one place and have it be universal. Hopefully your project is not too far into development :smiley: , 'cause changing the name requires a fresh start with a new project as far as I know.

Please note that I’m still running 10.2, so if the brains over at apple were thinking when they shipped xcode, they may have included a “Rename Project” option somewhere…but I haven’t heard anything about it. If you think you’ve done the job renaming everything and changing all of the references, you could try cleaning and rebuilding the target, quitting, and then restarting xcode and trying to build and run. I doubt that will work, but it’s worth a last effort. :wink:

Good luck…
j

No, you can change it. It is a pain, however. The easiest thing to do is simply to change the name of the target. Under the “Targets” group in the “Groups & Files” pane, select the primary target (probably the only subitem). First, with this target selected, type Command-I and change the name of the target. Then, show the editor for the target and in the “Summary” pane, update the “Base product name”. Also update any InfoPlist strings. Finally, clean your target and then rebuild. No need to rename the main AppleScript or any other resources.

Jon

Thanks for the replies.
Jon, the method you described worked great. I was wondering if you found that info in some documentation or just figure it out with trial and error. Thanks again.

Dom

John, thanks for that info. i tried to do that unsuccessfully once in the past. but one question: what about the directory the project is actually saved in?

changng the directory’s name doesn’t change anything. You have to change the Target’s name, as well as any reference to the old name you can find in the .plist, etc.

Using Xcode 2.4, to rename a project is similar to jonn8’s method but Xcode may have changed a little since his post. So here is an update. Firstly always make a backup of your project folder, I just duplicate it in the Finder. Then work with the copy.

Under the “Targets” group in the “Groups & Files” pane, select the primary target (probably the only subitem). First, with this target selected, type Command-I to show the inspector and change the name of the target under the GENERAL tab. Next under the BUILD tab choose the configuration then from the collection popup menu choose Packaging. At the top of the table view should be Product Name under the Setting column. Change the Product Name Value to the new name. Close the inspector.
Now modify info.plist in the “Groups & Files” pane by double clicking info.plist. In the editor look for

change YOURAPPSNAME to the new name. If you want to edit the version numbers of your app change the strings for both these keys

and

change the CFBundleIdentifier key

If you need to change your apps icon and document icon, first make sure you have copied the new icon files MyAppIcon.icns, MyDocIcon.icns to your project.
The CFBundleIconFile key changes your APP’S icon (leave out the .icns extension)

to change the document icon look under CFBundleDocumentTypes and change the CFBundleTypeIconFile key

and to change the file extension your app uses under CFBundleDocumentTypes and change the CFBundleTypeExtensions key

The creator code can be changed by editing the CFBundleSignature key, this must be four alphabetical characters mixed upper and lower case and hopefully unique to your app, only Apple (Your Lord and Master ;)) is allowed to use all lower case creator codes.

Under the scripts folder in the “Groups & Files” pane right click the applescript you would like to rename and select rename, don’t do this in the Finder.
With the project closed change the ProjectName.xcodeproj to NewProjectName.xcodeproj.
Hopefully, that’s all there is to it!

Model: Mac Mini G4 Mac OS X 10.4.8
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi All,

Great exchanges here! Thanks for the info.

I had this problem before, went thru the pain of trial and error (and to say the least, screwing my application) with nothing to show for it. My app is still stuck with some names I do not much like.

Now, I have a chance to change it to something more descriptive of the application.

Many thanks once more.

archseed :slight_smile:

Post script to PizzaCake’s update. You will want to visit IB and change things there as well. For example window titles, menu titles, and so on. Also, you may have to re-set your handler pointers for various objects to point to the newly named “main” script.