Re: adding file reference via applescript
Re: adding file reference via applescript
- Subject: Re: adding file reference via applescript
- From: Rick Ballard <email@hidden>
- Date: Wed, 16 Nov 2005 11:41:11 -0800
On Nov 16, 2005, at 8:53 AM, Dmitry Markman wrote:
Hi
I'm trying to add file reference to the group via applescript with
the following command:
set new_file to make new file reference with properties {file
kind:"sourcecode.cpp.cpp", name:file_name, file encoding:"macos
roman", full path:full_file_path, path:file_name}
properties name, full path and path were set successfully
but file kind and file encoding were not
all properties (except file encoding) marked as r/o in the XCode
dictionary
(but I'm creating NEW file reference so I think I can provide those
properties's initial values)
XCode dictionary has the following definition of the file encoding
property:
"file encoding (iso 2022 japanese/iso latin 1/iso latin 2/Japanese
EUC/macos roman/nextstep/nonlossy ascii/shift jis string/symbol
string/unicode/utf8/windows cyrillic/windows greek/windows latin 1/
windows latin 2/windows turkish) : ..."
that's why I use "macos roman" for file encoding property
XCode successfully creates and adds new file reference into the
group with the right
name, full path and path properties, BUT file kind is always "file"
and file encoding is undefined.
also: I can open that file from XCode by 2click on it,
but it doesn't not colorize c++ key words (because it doesn't have
right kind I think)
File kind is unfortunately not currently settable via applescript.
File encoding is settable, but it takes one of the values displayed
in the dictionary next to the file encoding property, not a string.
To set the file encoding, instead of specifying "macos roman", you
specify macos roman (without the quotes).
Xcode colorizes files based on their file kind, so for now you'll
need to either manually set the file kind on your file references or
give you file references a file extension that corresponds to their
file kind (e.g. '.cpp' for a c++ file).
- Rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden