Full Screen in AppleScript Studio Application

Did you ever want to make a full screen application with AppleScript Studio? It’s not that hard! Just subclass NSWindow with Objective-C. Here are the steps to make a full screen window:

Step 1: Subclass NSWindow
Add the following file’s to your project:

IEFFullScreen.h

IEFFullScreen.m

Step 2: Change Identification in Interface Builder
In the Inspector-window of IB apply the same changes as in the image for your window.
Image: http://img222.imageshack.us/img222/9959/afbeelding1i.png

Step 3: Access the window in AppleScript

tell window 1 to .

I hope this is helpful for some people,
ief2

PS: An example is available at http://uploading.com/files/e4e3f6ae/SimpleFullScreen.zip/ (or http://aghyour.com/verzenden/download.php?file=f2c42e7426e56b4ea08583980aaf14b4)

Personally, I think this function is amazingly simple, but what would be nice is a way to TOGGLE it.

Right now, it’s full screen only.

Preferably if I made a full screen app, I wouldn’t just have the window take over the screen. I would give the user a menu item or something to choose whether they want it or not.

Is there a simple edit I can make to add this small feature?

Otherwise, this class is awesome!

-SuperScripter

Well, you could implant it, but you’d loose the ability to create a window without a title bar. That is because you can’t change the style mask of a window after you’ve created it.
IEFFullScreen.h

IEFFullScreen.m

An AppleScript Text File with clicked handlers connected

-- AppController.applescript
-- FS

--  Created by ief2 on 11/03/10.
--  Copyright 2010 __MyCompanyName__. All rights reserved.

on clicked theObject
	if name of theObject is "Toggle" then
		call method "toggleFullscreen" of (window 1)
	end if
	
	if name of theObject is "ON" then
		call method "setFullscreenEnabled:" of (window 1) with parameters {yes}
	end if
	
	if name of theObject is "OFF" then
		call method "setFullscreenEnabled:" of (window 1) with parameters {no}
	end if
end clicked

Example:
http://uploading.com/files/ad264f75/FS.zip/
http://aghyour.com/verzenden/download.php?file=053ff4a17c544f668ff72d7472a5737f

Hope it helps,
ief2

Wow, thanks for that, ief2!

Is there any way to dynamically make the window not movable?

Also, about the style mask thing - that means that you can’t change whether a window is textured or not programmatically, right?

-SuperScripter

I don’t know how to do it in a clean way (I’m not so advanced myself), but I would do it like this:
IEFFullScreen.m

Hope it works,
ief2

Actually, I thought of just doing:

on idle
call method "center" of window 0
end idle

While I haven’t tested either your solution or this one, I believe it’ll work, and it’s lightweight and simple.

Again, thanks for all the help!

-SuperScripter