Show Desktop from Projector

Date:    Mon, 30 Mar 1998 14:26:43 -0500
From:    Keith Seward 
Subject: TIP:  show desktop from projector
The funny thing about programming is that it's all work and yet it's more fun to write code you don't need than code you do need -- if you know what I mean. In that spirit, since I had to write some Master App routines today, I also produced this little handler to put to rest the "desktop access from full-screen stage" thread.

(You don't absolutely have to have Master App to do this however: on the mac, you can use the "open" command just to launch the finder. You can find a path to the system folder using fileIO's "getOSdirectory" function.

For example:

on mouseUp
  set myDirectory = getOSdirectory()
  open myDirectory & "Finder"
end
This enables the user to access the finder, though the projector mask remains in the background unless you select "hide others" from the finder menu.

On Windows I'm not sure what you'd launch instead of the Finder on Mac...)

The master app code works on both Mac and Win, though perhaps Glen can explain why a different method seemed to be needed for each platform. On Windows, it was very simple just to minimize the director or projector window. On Macintosh, I couldn't seem to pull the finder or desktop window to front. This necessitated that I use the task ID of the finder. This too leaves the projector mask in the background, so if anyone has any suggestions for getting rid of it we'd have a nice can of code...

The global in the script below is an instance of Master App. Refer to your instructions.



on showDesktop
  global gMA  -- instance of master app

  case (the machineType) of

    "256":
      -- windows
      set dirWin = gMA(mDirectorMainWindow)
      gMA(mMinimizeWindow, dirWin)

    otherwise
      -- macintosh
      set taskText = gMA(mGetTaskIDs)
      repeat with i = 1 to the number of words of taskText
        set myTask = value(word i of taskText)
        set taskName = gMA(mTaskName, myTask)
        if taskName contains "finder" then
          set myDesktop = myTask
          gMA(mTaskToFront, myTask)
        end if
      end repeat
  end case

end showDesktop

k e i t h s e w a r d
n e c r o e n e m a a m a l g a m a t e d
http://www.necroenema.com