Table View(テーブルビュー)を使う(2) [AppleScript辞書はつくれるか?]
script AppDelegate
property parent : class "NSObject"
property arrayController : missing value
property theData : {}
property tableView1 : missing value
property textField1 : missing value
on action1_(sender)
(*ここは後で書きます*)
end action1_
-- IBOutlets
property theWindow : missing value
on applicationWillFinishLaunching_(aNotification)
--
end applicationWillFinishLaunching_
on applicationShouldTerminateAfterLastWindowClosed_(sender)
return true
end applicationShouldTerminateAfterLastWindowClosed_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
end script
on applicationWillFinishLaunching_(aNotification)
tell application "Finder"
set objList to name of (every item of folder (("/System/Library/Sounds" as POSIX file) as text))
end tell
set testData to {}
repeat with i from 1 to (count of objList)
set testData to testData & {{data1: i, data2: (item i of objList)}}
end repeat
set my theData to testData
end applicationWillFinishLaunching_
on action1_(sender)
tell ArrayController to set theSelect to selectedObjects()
set ans to "Data1: " & (data1 of theSelect) & " / Data2: " & (data2 of theSelect)
textField1's setStringValue_(ans)
tell ArrayController to set theSelect to selectionIndex()
log theSelect
end action1_
コメント 0