I have such an AppleScript:
tell application "Firefox"
activate
set the bounds of the first window to {0, 0, 6000, 6000}
end tell
But this code doesn't let me to re-size the height of the window higher than the screen bounds.
How can I make this happen?
p.s. The window width is set to 6000px successfully, but no luck with window height.
Thanks
As far as I know, the OS doesn't let you resize the height of ANY window higher than screen bounds, which is probably why you're hitting this limitation. Which means, there's no acceptable solution for your problem.
Related
how do I set the size of a multi-platform app in xcode (spritekit) ? I know that you can't change the window size on iphone but this app is multi-platform and can also run on macos. So how do I set the window size and make it unable to be stretched but able to full-screen? (on macos) and I was also wandering is there was a way to select the window's starting position. Thanks!
P.S. sorry for asking this stupid question just I'm a beginner so I don't know.
I had tried searching for an answer but I did not find one.
If you are using storyboards you can specify a window controller's size and position as parameters in the Size inspector. To block stretching, turn the Resize control off in the Attributes inspector. Turning Restorable off also helps, otherwise AppKit will try to restore the previous state of the window frame.
Alternately, you can set the window size and origin programmatically, for instance in NSViewController.viewDidLoad:
DispatchQueue.main.async {
let origin = CGPoint(x: 0, y: 0)
let size = CGSize(width: 800, height: 600)
self.view.window?.setFrame(NSRect(origin: origin, size: size), display: true)
self.view.window?.styleMask.remove([.resizable]) //turn off Resize control
}
I am trying to change the size of the UI Elements within a UWP Window on the change of the size of the window itself, such as clicking the edge of the window and dragging right. However, on increase of size, there seems to be Bounds set on the creation of the Window for the maximum size of the content, is there anyway to bypass this Bounds?
Try setting the UI Element's HorizontalAlignment and/or VerticalAlignment to "Stretch". Alternatively, if you want to scale it too, you may put the whole thing in a ViewBox. There are really quite a few options to achieve what you want.
B"H
When I'm openning a web browser like chrome, I can resize the width of the window to some width, but not more then a certain maximum.
I want to open it to size like 3000x3000, more then my screen resolution.
Is it possible?
Thanks
Elchanan
You can use zoom for this purpose. For Chrome and Opera right click on the page, go to "Inspect", then press "Toogle Device Toolbar" (Ctrl+Shift+M). In the toolbar you can specify a big resolution like 3000x3000 and it will adjust zoom according to your screen resolution.
This seems like a very basic question, but I couldn't find the answer anywhere. How do I launch my non-resizable OS X application window in the center of the screen?
If you select your top level window, the Size Inspector will show you a screen similar to this
You can then drag the representation of your window to where you want it to be positioned when launched, or set the specific coordinates.
You can choose the center position for the window in Interface Builder by choosing the size inspector. Otherwise you can call [window center] in applicationDidFinishLaunching
I get a list of CGWindows using CGWindowListCreate as shown below:
CFArrayRef windows = CGWindowListCreate(kCGWindowListOptionOnScreenOnly, 0);
Is there a way to tell which NSScreen each window is on? I've trying looking at the intersection of window bounds and the frames of the screens, but if a window is partially off screen it can intersect with the frame of another screen.
Is there a more reliable way to do this?