MACSCRPT Archives

June 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Phillip Apley <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 2 Jun 2006 14:28:57 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (117 lines)
I used the example code from the applescript studio reference (url and text
below) to make a sample outline in Xcode. In interface builder I create a
window with an outline view. All I change from default is window names, and
I attach the Œon launchedı method. When I run the code from the example as
the Œon launchedı method of the application. I get a couple of triangles
that open and close, demonstrating that the sample outline structure is
there, but thereıs no text displayed for the outline items or column names.
I had run a similar example using a more complicated example and got the
same result, which led me to try the simple example in the documentation.

http://developer.apple.com/documentation/AppleScript/Reference/StudioReferen
ce/index.html?http://developer.apple.com/documentation/AppleScript/Reference
/StudioReference/sr6_data_suite/chapter_6_section_8.html#//apple_ref/doc/uid
/20011220-ASKDataViewSuite.Classes.ASKDataItem

Iıve been trying to fix this for a couple of days. Iıve examined the object
structure using script debugger 4 looking for visibility flags, though I may
have missed something there. I suspect the problem is a regression ina
recent version of something: perhaps Xcode 2.2.1, latest Applescript, OS
10.4.6. 

Does anyone have any ideas for me? If anyone else could confirm they get the
same problem that would be great.

Hereıs the actual code Iım running, changed only to reflect the names of the
windows: 

--  Created by Phillip Apley on 6/2/06.
--  Copyright 2006 __MyCompanyName__. All rights reserved.

on launched theObject
    tell application "outlinetest"
        -- Create the data source; this places it in the application
        --  objectıs data source elements. (Assign it to outline view
below.)
        set dataSource to make new data source at end of data sources with
properties {name:"tasks"}
        -- Create the data columns
        tell dataSource
            make new data column at end of data columns with properties
{name:"task"}
            make new data column at end of data columns with properties
{name:"completed"}
            
        end tell
        
        -- Create the top-level parent data item "Things to do"
        
        set parentItem to make new data item at end of data items of
dataSource
        
        set contents of data cell "task" of parentItem to "Things to do"
        
        set contents of data cell "completed" of parentItem to "--"
        
        -- Create the first child data item "Work on outline example",
which
        
        --  will have its own children
        
        set childItem to make new data item at end of data items of
parentItem
        
        set contents of data cell "task" of childItem to "Work on outline
example"
        
        set contents of data cell "completed" of childItem to "Yes"
        
        -- Create first child data item of "Work on outline example"
        
        set childChildItem to make new data item at end of data items of
childItem
        
        set contents of data cell "task" of childChildItem to "Make it plain
and simple"
        
        set contents of data cell "completed" of childChildItem to "Yes"
        
        -- Create second child data item of "Work on outline example"
        
        set childChildItem to make new data item at end of data items of
childItem
        
        set contents of data cell "task" of childChildItem to "Put it all in
a \"launched\" event handler"
        
        set contents of data cell "completed" of childChildItem to "Yes"
        
        -- Create the second child data item of "Things to do"
        
        set childItem to make new data item at end of data items of
parentItem
        
        set contents of data cell "task" of childItem to "Put it in my iDisk
when done"
        
        set contents of data cell "completed" of childItem to "No"
        
        -- Assign the data source to the outline view
        set data source of outline view "outlineview" of scroll view "tasks"
of window "outlinetest" to dataSource
        -- this doesnıt help
        -- tell outline view "outlineview" of scroll view "tasks" of window
"outlinetest" to update
        
    end tell
end launched


-- 
Phillip G. Apley
Critical Engineering Associates
34 Ridgemont Street
Allston, MA 02134
cel: 617-283-1717
pga@alum dot mit dot edu

ATOM RSS1 RSS2