Sunday, December 17, 2017

#1 2009-11-09 08:15:44 pm

ttt1107
Member
Registered: 2009-08-14
Posts: 63

Window Properties

How do you tell a window to be on top of other windows. Like in applescript studio you did this:

tell window "mainwin"
set floating to true
end tell

Also how do you set a window's alpha value? In ASStudio you would do this

set alpha value of window win_1 to 50


Furthermore how would you set a windows title using script?


Filed under: window, Properties

Offline

 

#2 2009-11-10 04:59:43 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5200

Re: Window Properties

ttt1107 wrote:

How do you tell a window to be on top of other windows.


Check out the setLevel_ method.

Also how do you set a window's alpha value?


You don't; you set the alpha of it's content view, usually in IB.


Furthermore how would you set a windows title using script?


Use setTitle_.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#3 2009-11-10 05:09:13 am

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: Window Properties

setTitleWithRepresentedFilename_ might also interest you, make sure it's coerced as a POSIX file.

Offline

 

#4 2009-11-10 06:05:36 pm

ttt1107
Member
Registered: 2009-08-14
Posts: 63

Re: Window Properties

Well in ASStudio I was able to change the alpha value of windows to make them fade or to just change it for user preference using the exact line I used above.

Offline

 

#5 2009-11-10 06:31:18 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: Window Properties

And nobody bothered to search? XD me neither!

NSWindow... yikes never would have guessed.

setAlphaValue:

Applies a given alpha value to the entire window.

- (void)setAlphaValue:(CGFloat)windowAlpha


alphaValue

Returns the window’s alpha value.

- (CGFloat)alphaValue

Last edited by Richard (2009-11-10 06:31:55 pm)

Offline

 

#6 2009-11-11 01:50:13 am

ttt1107
Member
Registered: 2009-08-14
Posts: 63

Re: Window Properties

How would your write that if the window is:
property mainwin : missing value

Offline

 

#7 2009-11-11 09:25:19 am

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: Window Properties

mainwin's setAlphaValue_(0.7) --good example

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)