resizing an applescript studio window with jons commands

ok so far i have this

		set screen_list to (screen list)
		set first_screen to (item 1 of screen_list)
		set screen_resolution to (screen size of first_screen)
		tell window "game"
			set screen size to screen_resolution
		end tell

and i get this error

Can’t make «class escS» of window “game” into type reference. (-1700)

What exactly is your motivation behind using jons commands to handle window resizing? There are cocoa methods available to you for this. If this is something that you’ll be using for anyone but yourself, you should try to avoid using scripting additions whenever this easy of a cocoa solution is available to you. I’ve posted code for getting the screen size before (search forum for ‘nsscreen’) and you can use that with plain old applescript to set your window’s size.

(By the way, I would never use jons commands, but I’m guessing that ‘screen size’ is not one of the properties available to use for window objects. It’s probably just “size”.)


i’m using jons commands because theres a thing that gets the screen resolution thats why i’m using it. is there another way of getting the screen resolution and setting the window to that size, or just making the window fullscreen? i already got rid of the menu bar and dock.

Did you actually do a search for nsscreen, or do you not bother to take this into your own hands. All of the questions you’ve asked about resizing and full screen have been covered many times before. I know that for a fact because I continue to post replies to people asking the same questions over and over without simply spending 10 minutes searching. Just yesterday or the day before a thread covering full screen began. While it doesn’t offer much in the way of code, it opens the door for you to start getting an idea of what’s involved and what the terminology and classes are that you need to work with to accomplish the task. Check out the list of threads I made in my last post in this thread… and again, SEARCH AND LEARN! Once you’ve acquired a screen size use the ‘bounds’ property of the window (simple list of {left, bottom, right, top}) to set it to that size and position. Simply setting the size won’t help because the position will stay the same.

We can only hold your hand for so long before you’ve got to start standing on your own. Take the time to research things before you throw all of these expectations and uninformed questions on us… especially when someone gives you an easy list of resources to follow. I have never encountered a reason to use a scripting addition in an ASStudio application. The cocoa and carbon frameworks offer you everything you need to accomplish all of the things that osax’ provide you. In fact, most of the scripting additions are likely written using these frameworks. My guess is that jon’s commands is merely a wrapper for the cocoa methods I and others cover in many threads already written about resizing to full screen. Adding a scripting addition to your project just to get something that’s already built in is redundant and ignorant. Just take the time to learn how to use the actual frameworks yourself (which in this case is easy and already laid out for you in other threads), or at least how to learn how to find them so you can ask others the right questions about how to implement them.


i got it fullscreen, but is there a way to get rid of the part of the window at the top with the window title? and also is there a way to lock the window inplace and and disable expose so you cant switch out of it. and how do i get the current screen size? i did search.



For every time you bump this (or any) post, I will refrain from helping you with 5 billion trillion legitimate posts you make. So far you’re negative 10 billion trillion. Have fun on my blacklist. :rolleyes:

please stop wasting my time, and help me if you know how to do this.

Wasting YOUR time?! How dare you! I’m not paid to be here, and I don’t have to help you at all. Pretty much everyone else here seems to understand that people like me help those that help themselves. I have been helping people here at macscripter for years, and I think you’re probably one of the most rude and selfish I’ve run into. Do you think that we’re all just sitting around waiting to help just you? We have jobs, and families, and lives that require us to be somewhere else most of the time. In my opinion, you are lucky that I spent the time that I did helping you. I’ve never read an applescript book and I can count on one hand the number of times I’ve posted questions to the forum rather than answers. I learned EVERYTHING I know about programming from what I found on my own. The answers are out there on the internet, they’re available to you all the time, and all you need to do is go get them. And best of all, they’re free. You only have to look for them (or have them handed to you) and spend YOUR OWN TIME figuring them out. I and many of use here are happy to help you, as long as you’re doing most of your own work. You, though, are obviously not carrying your own weight. When I give you links to many posts which already give you step-by-step instructions on how to do something, and then you tell me that you can’t find them… what more would you like me to do about it? Since you keep asking the same questions, maybe I should keep posting my same answers. Or better yet, just write down all of your ideas and send them to me and I’ll just develop your whole app for you. Do you have ANY IDEA how much time it takes not only to figure some of these programming tasks out, but to then explain them in a meaningful way to someone who is not only inexperienced but also lazy? I don’t have the time to sit here and hold your hand through all of these things, and I doubt that others do either. And, what little time I do have I’m going to spend helping people who are givers, not just takers, and who have a higher level of respect, responsibility, and appreciation for the fact that what help I do give is a gift. Everything you’re trying to do has been covered here before. If you can’t see that, it’s most certainly YOU who’s wasting your time.

Good luck,

i have searched this forum for a very long time and found nothing about disabling expose and locking a window in place.