How to Fix Variable Typos Like Changing mynewLabel to myNewLabel?

Hi All,
If I have a variable that I miss-typed as mynewVariable, when I change it to what I want - myNewVariable, xcode automatically changes it back to the original. I know that I’ve seen the solution to this in other posts, but I can’t seem to find them. Thanks in advance for any help.

You’re probably using xcode 3.x right?

  1. Stop xcode and applescript if open.
  2. Open the .applescript files with a text editor like text edit for example in your project folder
  3. In your text editor change the variable names and save the files
  4. Start xcode again and reopen your project. Everything should now be changed.

That did it. Thanks!

It’s probably worth pointing out that this is an AppleScript problem, not an Xcode problem. And you need to make sure you use a UTF-8 aware editor.

For what it’s worth, you don’t need to open it in a different editor. Just delete the offending letter, close Xcode, reopen, and type it in correctly.

Ric

But won’t you have to delete the character(s) in every instance? Whereas the text editor method means changing it just the first time. This is assuming Xcode 3.

With Xcode 4, a simple quit and reopen is probably all you need, as long as you then change the first instance before running the app. But you run the risk of confusing yourself, because the file will still keep opening and appearing with the second an subsequent instances unchanged (unless you do an S & R).

Messy business…

What do you mean by “just the first time”? Do you mean you can just change the first instance of a wrongly spelled name? I tried that with text edit, and it didn’t work – the names were still wrong.

Ric

Yes. You still have to quit Xcode and relaunch it. And the “first” time is the time the compiler will see first.

What shane means and I was that when working with an editor you’ll only need to replace the first variable for the interpreter.

this:

set theFile to ""
set thefile to ""
set thefile to ""

will eventually be:

set theFile to ""
set theFile to ""
set theFile to ""

So ‘theFile’ is what the compiler sees first and the rest will be corrected.