I am new to the apple script. I want to write an AppleScript that opens
a CodeWarrior and creates new .mcp (project file) and apply some
settings to the project file. I don't know whether its possible or
not.. Can someone guide me how to do it.
Thanks in advance.
Create a new project file:
Create Project "users:myhome:projs:NewProj.mcp" from stationery alias
"where:I:keep:stationery:stationery.mcp"
Apply some settings:
Access paths:
on AppendAccessPath(aPath, isRecursive, isUserPath)
tell application "CodeWarrior IDE"
if (aPath does not end with ":") then set aPath to aPath & ":"
set aPath to POSIX path of aPath
set pathsToAdd to {{name:aPath, recursive:isRecursive,
origin:absolute, format:Unix Path}}
if isUserPath then
Set Preferences of panel "Access Paths" to {User Paths:pathsToAdd}
else
Set Preferences of panel "Access Paths" to {System Paths:pathsToAdd}
end if
end tell
end AppendAccessPath
Change target:
set the current target of project document 1 to target targetIndex
of project document 1
Change the preprocessor text:
Set Preferences of panel "C/C++ Preprocessor" to {Prefix Text:""}
Turn CVS on:
Set Preferences of panel "VCS Setup" to {VCS Active:true, Connection
Method:"mwCVS"}
Make sure and wrap all of the above in:
tell app "Codewarrior IDE"
...
end tell
For more, in Script Editor, open the dictionary of the Codewarrior
application.
Feel free to email me.