Displaying Window

How does one create an AppleScript input box so a user can enter text and the text is used in the script?

Also:
Any way to dial the modem without user name or password (voice call)

Here are some examples:

set dd to (display dialog "Enter your last name" default answer "Smith")
display dialog text returned of dd
set dd to (display dialog "Enter your short user name" default answer system attribute "USER")
display dialog text returned of dd
set dd to (display dialog "Enter your short user name" default answer "")
display dialog text returned of dd

– Rob

Thanks for the help!

I’m trying to display a window as a separate entity, so that you can close it with the red button at the top left. I know to make a window display as a sheet, you use this:

load nib "PreferencesPanel"
display window "preferences" attached to window "main"

So, I tried this to get it to display separately:

load nib "PreferencesPanel"
display window "preferences"

This works, but when the window is closed with the title bar, the Application dosen;t register it as closed. However, when I click the close button, it does register it as being closed. Can anyone let me know how to display a window so that the menu bar will properly close it? Thanks.

“Display” is used for panels, both separate and attached. Windows use the show/hide commands to make them active or inactive. If your nib containing the window is loaded use…

show window "preferences"

Likewise, hiding the window can be achieved by…

hide window "preferences"

Using ‘display’ will make the app wait for the panel to do it’s action before releasing it from being the primary window. Closing it with the red close button will bypass the necessary method’s of making the app aware that the window is closed. You may be able to use a ‘panel ended’ or other panel event (panel closed?) to detect whether the panel has ended which may release it from being the primary.

Also, if you want to use a window by itself without the window holding the focus until dismissed, you should create it as a window object, not as a panel object. This way you’ll be sure it is a regular window with window properties, and you won’t run into any unforseen grammatical or coding conflicts like the one you’ve found.

j

Hello,

This topic is interesting…
How do you display a window or a panel attached to a window, without holding focus on the the panel or window shown? (so that the main window is still accessible)

I’m asking because I’m trying out a toolbar and when it displays a panel, the toolbar itself is not accessible anymore (until the panel is closed)

Thanks in advance

Alright, just to be clearer, have a look at the preferences in Mail.app : this is EXACTLY what I’m trying to do.

Can anyone help me out with that ?

Right, nevermind I found a template so it’s all good. It’s a lot more complicated than I thought though, it would have taken me a while to figure out how to do that…

The magic word is modal

YYYYeah, that documentation, just like anything apple puts online to “help” developers out, just confuses the hell out me !

thank god i found that template, i’m so tired of reading apples confusing doc over and over again to try and come up with one line of code :confused: