A community of Frontier
and Radio Users


Meridian News


Community List


Regex Project

To bring Frontier frontmost from another application, I often use to click on any Frontier window. But depending on the number and position of opened windows, it may be difficult to find back the last used one. So I wrote those two little scripts:

user.callbacks.suspend.getFrontWin:

  on getFrontWin ()
    // Mer 7 jan 1998 at 18:00:35 by Flip
      // record the frontmost window's name
    system.temp.curFrontWin = window.frontmost ()
    system.temp.switchTime = double (clock.now ())

user.callbacks.resume.restoreFrontWin:

  on restoreFrontWin ()
    // Mer 7 jan 1998 at 18:01:40 by Flip
      // restore the frontmost window to last used
    if ((system.temp.switchTime + 2) < (double (clock.now ())))
      // frontier was in the background for more than 2 seconds
      // used because CopyPaste switches to the finder to convert the clipboard
      clock.waitSixtieths (20) // let time to the window which was clicked to come frontmost 
      window.bringToFront (system.temp.curFrontWin) // and then change it
    delete (@system.temp.curFrontWin)
    delete (@system.temp.switchTime)