Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to make a window like this

In Cocoa-Applescript

User uploaded file

MacBook Pro with Retina display, OS X Mountain Lion (10.8.4)

Posted on Aug 20, 2013 3:05 AM

Reply
Question marked as Best reply

Posted on Aug 20, 2013 9:17 AM

If you are using a Cocoa-AppleScript template, you have some work to do. Since the Interface Editor isn't available, you are going to have to do everything by hand. One way I've found that makes it a little easier is to create the UI in the Interface Editor, then look at the raw nib/xib file to see what the numbers are.


From the Interface Editor in an AppleScriptObjC Xcode project, there is a Window and Drawer object that you can drag from the library. This has a Drawer Content View that you can put your other objects in. In your screenshot the view has a label, a text field, a popup button, and an NSOutlineView.

8 replies
Question marked as Best reply

Aug 20, 2013 9:17 AM in response to deniz343

If you are using a Cocoa-AppleScript template, you have some work to do. Since the Interface Editor isn't available, you are going to have to do everything by hand. One way I've found that makes it a little easier is to create the UI in the Interface Editor, then look at the raw nib/xib file to see what the numbers are.


From the Interface Editor in an AppleScriptObjC Xcode project, there is a Window and Drawer object that you can drag from the library. This has a Drawer Content View that you can put your other objects in. In your screenshot the view has a label, a text field, a popup button, and an NSOutlineView.

Aug 22, 2013 4:15 AM in response to deniz343

Okey I found it it's in the bindings and only one bind is available "Visable" Doh! with a very basic script I can activate it


on click_(sender)

if x = false then

set my x to true

else

set my x to false

end if

end click_


There are two question: 1) What if I want to make second custom view 2)How I will add Drawers to my Main Project


And I know you're helping me a lot in cocoa-applescript but I need to ask you one more thing... I looked Documention, Internet but I couldn't find anything. Every topic that I've found is for AppleScript Studio (I know you know it since 1978 😀). How can I set dataSource for Outline View. I'm trying to show playlist folders and playlists in it. Actually I found how to show drawer when I post my lastest reply but Apple Discussions get into maintance 😀.

Aug 22, 2013 7:50 PM in response to deniz343

1) You can create whatever views you want, then use NSDrawer's setContentView: method to set the desired view before opening the drawer.


2) You can try to convert AppleScript Studio, since the various predefined handlers are basically wrappers around the equivalent Cocoa methods, but your best bet would be to use the Objective-C documentation - Outline View Programming Topics, for example. You will need to learn to read the Objective-C method declarations (and know your way around Cocoa), but the conversion to AppleScriptObjC is fairly easy.

How to make a window like this

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.