Howdy all,
How does one make a dialog or something of that type show up in that ‘printout’ window that comes out from under the title bar?
Unfortunatly, I don’t know it’s exact name, but it’ll show up (for example) like when Firefox has an error (can’t execute javascript or something like that) or when you try to close some applications without saving. (textedit does something simillar to what I’m talking about)
The idea is I would like this
set myvar to (choose folder with prompt "blahblah" without invisibles)
or
display dialog "blahblah"
to show up in one of those ‘printout’ windows instead of the normal dialog popup.
Anyone know what I’m talking about? Or know how to do it?
Thank ye
-Parrot
You’re looking for the attached to parameter
of the display command; This will make the window act as a “sheet.”
Note that standard commands like choose folder
and choose file
can not be attached to a window; Instead, use the open and save panels. Information on those (and more) can be found the same page that is linked to above (you should read most of it).
We’ll be here if/when you have more questions. 
Alright, I’ve got it up and working, thanks for all of your help 
Two questions, though.
1- How do I tell it to choose folders. “With can choose directories” only allows me to choose zip files, not folders. The properties listed with the “Open Panel” reference don’t seem to have any way to do this. Is there something I’m missing farther up the chain here?
2- How do I reference multiple windows attached in this manner? I have open panel 1 in tab 1, and open panel 2 in tab 2. How do I refer between the two when it comes to getting the resulting path list? (I’m using the “on panel ended theObject with result withResult” handler)
Set the properties before you display it.
tell open panel
set can choose directories to true
set can choose files to false
end tell
You could use a global and set it before you display the panel, then use the variable in the panel ended
handler to figure out what to do. (You could also try using separate scripts.)
In one project, which uses Bindings, I gave the buttons the same name as the default entry they would be updating; Then I used something like this:
global usingOpenPanelFor
on clicked theObject
tell open panel to set allows multiple selection to false
set usingOpenPanelFor to theObject's name
if result is "OutputFolder" then
tell open panel to set {can choose directories, can choose files} to {true, false}
else
tell open panel to set {can choose directories, can choose files} to {false, true}
end if
display open panel attached to window "Prefs"
end clicked
on panel ended theObject with result withResult
if withResult is 1 then
set content of default entry usingOpenPanelFor of user defaults to (path name of open panel)
end if
end panel ended
Sounds good, but I’m a little curious on Globals. Can any script in my app access them?
I.E- I have 3 scripts. 1, 2, and 3. Var1 is called in all 3 of these scripts.
As far as I know, setting them to a property value would only allow them to be used if the variable was set from within that script. (Meaning that Var1 would only be set correctly in script 2 if script 2 set it, it doesn’t see what script 1 did to it) Would a global set it correctly? Meaning I have a “Global Var1 : “”” in script 1. Would that mean that whatever Var1 is, both scripts 2 and 3 can access it, even without the Global tag in their scripts?
They would only be accesible in one script.