Installing On MacOS Using CodeWarrior

From WxWiki

Jump to: navigation, search

[edit] MacOS (with CodeWarrior)

wxWidgets comes with CodeWarrior exported XML files - of course, the trick is to get them converted into files CodeWarrior can open.

Normally the script in M8mcp2xml.applescript in the docs/mac/ folder should help. This script will go through your wxWidgets directory, finding and import all the .xml files into CodeWarrior.

Open this script in AppleScript's Script Editor. Script Editor is Apple's supplied IDE for AppleScript. You should be able to double-click the M8mcp2xml.applescript and open Script Editor, but, you have to manually open Script Editor.

Script Editor on OS 9 can be found in the Hard Drive:Applications:Apple Extras:AppleScript: . On OS X it can be found in /Applications/Apple Script/

Sometimes this script won't work, for whatever reason, and you have to Do It By Hand.

If you've used the command-line version of cvs to check out under OS X, files may not their proper file or creator types. File and Creator types are one method the Mac uses to determine what application should open a file.

If you just go into CodeWarrior and try to Import Project, you won't be able to select your project files - because they have the wrong type.

There are two ways of fixing this: If you're familiar with Unix and the Terminal, and have Apple's Developer Tools installed, the following line should work for you:

%Terminal find /path/to/wxWidgets -name '*M8.xml' -exec /Developer/Tools/SetFile -c CWIE -t TEXT {} \; %%

If you don't have Apple's Dev tools installed, or prefer to stay away from unix, the following AppleScript should help you out:

%AppleScript on run

   set myFile to choose file
   concat({myFile})

end run

on concat(fileList)

   repeat with each in fileList
       
       tell application "Finder"
           if name of each contains "M5"
            or name of each contains "M7"
            or name of each contains "M8" then
            --you may need to remove the returns from the above line
               set creator type of each to "CWIE"
               set file type of each to "TEXT"
               log "set"
           end if
           
       end tell
   end repeat

end open %%

The unix script works on every M8 file found in a path, while the AppleScript lets you choose which file to open - but it will set the creator and type for CodeWarrior 5, 6, and 7 exported files as well.

Personal tools