Black screen with arrow key menu.

Is it possible using Applescript to make the whole screen black and make a menu in the center which is moved my arrow keys and selected by the enter key?

No. It IS possible using applescript studio along with some custom obj-c calls, though.

Here is a common approach…

  1. To make the screen black, you have to create a window which you use to obscure the whole screen. You must create the window as a borderless window (do a search for “nsborderlesswindowmask”). This requires using a custom nswindow subclass that draws the window with no border or title bar. Check out my ‘tutorial’ post in this thread for an example of the methods needed to do this. Note that clicking at the very edge of the window brings the menu, dock, maybe finder forward, so you might want to use…
call method "setMenuBarVisible:" of class "NSMenu" with parameter false

… somewhere in your AS initialization to hide the menu bar and dock (can’t guarantee that this will help entirely, but it might.)

1a) Once you create the background window, you must make it full screen. This requires some more obj-c that gets the current screen frame…

[code]+(float)screenWidth
{ return [[NSScreen mainScreen] frame].size.width; }

+(float)screenHeight
{ return [[NSScreen mainScreen] frame].size.height; }[/code]
You can access these methods using AS something like…

set screenWidth to call method "screenWidth" of class "MYMethods"

… and use the values returned to set the size of the window to full screen size in your script.

1b) You need to choose a method of drawing the background of your window. In most of the examples of the borderless window you’ll find at macscripter (many of which I posted) there is a line in the window init method that draws the window background. For example, in the post linked above, there’s a line “[result setBackgroundColor: [NSColor clearColor]];”. If you substitute “blackColor” for “clearColor”, it should draw the background of the window completely black. If you want a custom window, you’ll have to either come up with methods of drawing it in custom views, or placing an image view in the window that contains your window frame.

  1. If the location of your content (your “menu”) is not absolutely fixed on the screen… i.e. it is required to be draggable or moved other than by programmatic methods… you’ll need to create a second window that contains your content. If the content just sit in one place, you may be able to get away with placing your content into the background window, too.

  2. It’s unclear what you mean by a “menu”. Real NSMenu’s only pop up/pull down, so they will not be a visible menu all the time. A reasonable workaround would be to use a table view. It can be controlled by the arrow keys, and you could either add a button to the window that captured your return key press or you could subclass the view or the window and use that to capture the key press. Probably easiest to just add a button that has a key equiv of return.

Basically, all of the things you need are easily possible. You will need to extend your features using obj-c, but the methods you require aren’t too complicated and should be pretty well documented here and on the interweb.

have fun,
j