Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting Project Builder to recognize stylesheets as editable files



To All,

I Found a way to coerce Project Builder to recognize style sheets as editable text files.
It appears the problem was that PB did not know what to do with the .css extension.

THE PROBLEM.
If I want to edit a style sheet, I have to first click on the file name in the left pane, then right mouse click (I have a two button mouse) or Control click, then from the popup menu choose "Open as ...", then choose "Plain Text File".

This is annoying. I want to somehow make an "association" to have Project Builder open this file when I click on it.

Another side effect of this problem is that if the stylesheet was the last file I edited before I close the project in Project Builder, then the next time I open the project, I get this error message:

Could not find file /Users/myuser/MyProject/WebServerResources/stylesheets/ MainStyleSheet.css. Perhaps it was moved or deleted?

I am using "css" as a file extension which I think is the problem as Project Builder does not know what to do with "css".

AND NOW THE FIX!

NOTE: Make a copy of your original files first before performing this tweak!

There is a plist file located in /System/Library/PrivateFrameworks/PBXCore.framework/Resources called "Standard file types.pbfilespec".

This file contains all the magic file types and their "opener" definitions.

To add files with a ".css" extension, locate a key in the file called "PBXHTMLFileType"

You should see a dictionary construct that looks something like:
{
Identifier = text.html;
BasedOn = text;
Extensions = (htm, html, htmld);
MIMETypes = ("text/html");
Class = PBXHTMLFileType;
ComputerLanguage = html;
},

Change:
Extensions = (htm, html, htmld);
to:
Extensions = (css, htm, html, htmld);

Save the file.
NOTE: You will first need to sudo chmod 666 the file as it is owned by root. And make the Resources directory write-able.

Kill PB if opened. Relaunch PB. If you have a file with a "css" extension, you should now be able to click on the file in the left pane and it will display in the right pane.

I am sure this is not the "proper" location in the Standard file types.pbfilespec file to place this tweak, but it works for me.

Jerry E. Porter
Software Engineer
Wireless Matrix Corporation
102, 1530 - 27th Ave. NE
Calgary, Alberta, Canada
T2E 7S6
Main: 1-403-250-3949
Fax: 1-403-250-8163
email@hidden
http://www.wirelessmatrixcorp.com
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.