Mailing Lists: Apple Mailing Lists

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

Re: Saving a data file



Unfortunately you can't just copy the event handlers in to the .applescript file. You need to go into the Document.nib (or whatever nib contains your document window) and select the File's Owner object, bring up the AppleScript inspector and add the data representation and load data representation event handlers there.

Fantastic! This helped a lot - but could there be a "bug" in ASS? When I activate those handlers, he puts into my code

on load data representation theObject of type ofType with data withData

instead of

on load data representation theObject of type ofType with data theData (as used in the examples)

Well, with the correction, it works. Thanks a lot. Now there's something left I would like to add, but can't seem to find out how. I want the application to be a single-window app. When I load new data though, it's being opened in a new window instead of the old one.

I used:

"on load data representation theObject of type ofType with data theData
set theWindow to window 1 of theObject
-- Set some local variables to various objects in the UI
set cardsDataSource to data source of table view "cards" of scroll view "cards" of theWindow

-- Restore the sort column and sort order of the data source based on the information saved
set sort column of cardsDataSource to data column (sortColumnName of theData) of cardsDataSource
set sort order of sort column of cardsDataSource to (sortColumnOrder of theData)

-- Use the "append" verb to quickly populate the data source with the list of tasks
append the cardsDataSource with (cards of theData)

-- We return true, signaling that everything worked correctly. If you return "false" then the document will fail to load and an alert will be presented.
return true
end load data representation"

I thought it'd be in the "set theWindow to window 1 of theObject", but changing this to the main-windows name doesn't help. Any hint?

Thanks again and best regards,
Tassilo
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Saving a data file (From: Tim Bumgarner <email@hidden>)



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.