Although I was successful (I've attached it here for anybody who's
interested), it's dog-meat slow (on my IIsi, anyway; my PMac's fast enough
that I don't notice, but it's still a gross waste of clock-cycles). The
main reason is what appears to be a serious inadequacy in the IDE's object
model. As far as I can tell, the only way to get the file dependencies
from the IDE is through the «GFil» event, and the only way to use that is
with "get project file number segment number" type syntax. I don't know
(or care) what file number of what segment number I have; I know the
file's name. I'm thus forced to do a «GSeg» to get a list of all segments,
extract the «NumF» field of each to get the number of files in each
segment, then iterate through to do a «GFil» on each to compare names.
Once I get a match, I can finally parse the «IncF» field for the info I
want. Gross.
What I can't figure out is that every other comparable event supports
passing a name, e.g, «FInP», «Comp», «PreC», «Toch», etc, but I've done
some pretty extensive hacking around in AppleScript and AEGizmos and
haven't turned up a way to refer to a project file directly by name.
By comparison, Think evidently supports the following two lines of Tcl:
set event [join [concat {obj\ \{want:type('prop'),\ from:obj\
\{want:type('SFIL'),\ from:'null'(),\ form:'name', seld:³} [file tail $name]
{²\},\ form:'prop',\ seld:type('INCL')\}}] ""]
set blah [AEBuild -r $THINK "core" "getd" "----" $event]
(for those who don't read Tcl or AEGizmos, a rough AppleScript translation is:
get the includes list from the source file named ³name²
compared to my (apparently necessary)
get the segments of the current project
build a list containing the file count of each segment
for ( each file of each segment )
is its name equal to ³name²?
if we got a match, extract its includes
)
Am I completely missing a more direct way to get information about a file
of known name?
__________________________________________________________________
Jonathan E. Guyer
Dept. of Materials Science Zairyoo Kagakka
Northwestern University Noosuesutan Daigaku