Satimage Previous
Making an inter-application floating dialog
Home Documentation Smile Custom GUI Developing your own custom dialog Making an inter-application floating dialog  
Using a floating palette in Smile
To display a dialog as a floating window in Smile, set its floating property to true at the dialog's creation's time.
set f to FindInMoreStuff("palette gk.bundle")
try
    set w to first dialog whose floating is true and path name is f
on error
    set w to make new dialog with properties {path name:f, floating:true}
end try


Import script
Using a floating palette in any application
To display a dialog as a floating window in every application, set its utility window property to true during the dialog's creation.
set s to "/Applications/Smile/User Scripts/ 1Default user scripts/More Smile commands/_7Programmer/ 2/HexaDeciText.bundle"
set f to (POSIX file s) as alias

try
    set w to first dialog whose utility window is true and path name is f
on error
    set w to make new dialog with properties {path name:f, utility window:true}
end try


Import script
Using a floating palette in a specific application
Smile's context receives a switched to event whenever the frontmost application switches. You can use the event to display a floating dialog only in a specific application. The following example displays the Set type and creator dialog (located in the Smile's User Scripts folder) only in Finder. Run the script below in an AppleScript terminal or save it in an AppleScript library.
set w to make new dialog with properties {path name:f, utility window:true, visible:false}
on switched to theApp
    set s to "/Applications/Smile/User Scripts/ 1Default user scripts/More Smile commands/_7Programmer/ 3/Set type and creator.bundle"
    set f to (POSIX file s) as alias
    try
        set w to first dialog whose utility window is true and path name is f
        set visible of w to (theApp is "Finder")
    end try
end switched to


Import script
Copyright ©2008 Paris, Satimage