Author Topic: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)  (Read 10337 times)

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
For the Mac Mini G4 Hacked ISO v8, the mouse cursor may freeze sometimes right after booting Mac OS 9. Since you can’t reboot without the mouse, you would have to force power off the Mac Mini G4. Instead of doing this, which can mess up the Mac OS 9 partition, you can create an Apple Script Application that reboots the Mac. Then set this to a Hot Key Function in Mac OS 9. Now when this happens, you can just press F1 to reboot correctly.

First we will make the Apple Script Application. All it will do is tell Finder to restart. Open Apple Script Editor, and put in the following to the blank window:

tell application “Finder”
restart
end tell

Then go to the menu bar and click File. Click Save As, and change the format to Application. You also need to uncheck Never Show Startup Screen. Now save the file anywhere you’d like. After that, you can quit the Apple Script Editor.

Now you can set a Hot Key Function to your Apple Script Application. Click the Apple Logo in the menu bar, go to Control Panels, then Keyboard. Click Hot Function Keys... . Make sure both check marks under Hot Function Key Settings are checked. Click F1 and assign it to the Apple Script Application made previously.

To test it out, press F1. Now you have the ability to safely reboot if the mouse cursor freezes right after booting. Maybe this could be implemented in a future ISO.
« Last Edit: February 16, 2020, 05:57:13 PM by alexfree »
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #1 on: February 16, 2020, 04:57:42 PM »
why would you think that restarting the finder will reboot the machine?
insert arbitrary signature here

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #2 on: February 16, 2020, 05:38:26 PM »
why would you think that restarting the finder will reboot the machine?

This is how it works in Apple Script, makes sense to me. If Finder goes down so does the OS. You can replace restart with shut down in the above script example and the resulting Apple Script Application shuts down the Mac instead.
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline Greystash

  • Gold Member
  • *****
  • Posts: 219
  • Too many Macs..
    • Mac Classic, Mac Attic
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #3 on: February 16, 2020, 06:36:28 PM »
Thanks! I hadn't thought about doing this, I thought it was just my system being weird with the intermittent mouse freezes.

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #4 on: February 16, 2020, 07:07:55 PM »
Thanks! I hadn't thought about doing this, I thought it was just my system being weird with the intermittent mouse freezes.

I saw someone mention they do this in the Mac Mini G4 hacked Mac OS 9 ISO development thread, but they never explained all the steps to do so. I then did some research to figure out all the steps.
« Last Edit: February 17, 2020, 03:51:25 AM by alexfree »
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #5 on: February 17, 2020, 12:12:18 PM »
This is how it works in Apple Script, makes sense to me. If Finder goes down so does the OS.

nope, that is two different things.
insert arbitrary signature here

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #6 on: February 17, 2020, 02:09:20 PM »
This is how it works in Apple Script, makes sense to me. If Finder goes down so does the OS.

nope, that is two different things.

Edit: iOS kept uploading a 0kb file with the files app >:( . Fixed the attachment by uploading via Photos app directly.

This attachment is a video of me opening the above script in Apple Script Editor and then executing it to reboot my Mac.
« Last Edit: February 17, 2020, 02:54:32 PM by alexfree »
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #7 on: February 17, 2020, 03:30:01 PM »
yes, that´s how a reboot works.

but restarting the finder is something else than rebooting the OS. :)

Code: [Select]
try
tell application "Finder" to quit
end try
delay 5
tell application "Finder" to activate
« Last Edit: February 17, 2020, 03:46:20 PM by IIO »
insert arbitrary signature here

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #8 on: February 17, 2020, 03:40:46 PM »

regarding your idea:

it is probably a bit dangerous to use F1 to directly reboot.

how could one add another keyboard command to confirm or cancel before it actually reboots?

i am all but firm with applescript.
insert arbitrary signature here

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #9 on: February 17, 2020, 03:45:50 PM »
another question.

there are applications which require or allow to use the function keys themselves.

will that safely replace the hot function keys of OS9 just like they usually also replace F keys from third party controlpanels or other applications which are open in background?
insert arbitrary signature here

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #10 on: February 17, 2020, 03:53:16 PM »
Since you can’t reboot without the mouse

and could you elaborate on this?

my mini reboots fine using the keyboard.

does that happen when the mouse freezes? (i cant induce a mouse freeze here now)
insert arbitrary signature here

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #11 on: February 17, 2020, 04:20:30 PM »
Since you can’t reboot without the mouse

and could you elaborate on this?

my mini reboots fine using the keyboard.

does that happen when the mouse freezes? (i cant induce a mouse freeze here now)

As far as I know, there is no way to reboot correctly and safely without using the mouse cursor to select restart. So if the mouse cursor freezes, I have no way to reboot but I do have access to the keyboard. When you say you reboot with the keyboard, how are you doing so without using the mouse cursor at all (other then what I do with the hot key).
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #12 on: February 17, 2020, 04:25:10 PM »
another question.

there are applications which require or allow to use the function keys themselves.

will that safely replace the hot function keys of OS9 just like they usually also replace F keys from third party controlpanels or other applications which are open in background?

Very good point! I’m honestly not sure. But as a workaround, since the mouse cursor freeze may only happen immediately after boot, you could just turn off the Hot Function Keys from within the keyboard control panel after a successful boot.

What are some specific applications using the function keys I could try that you know of?
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #13 on: February 17, 2020, 04:29:31 PM »

regarding your idea:

it is probably a bit dangerous to use F1 to directly reboot.

how could one add another keyboard command to confirm or cancel before it actually reboots?

i am all but firm with applescript.

You know, now that I think about it, I should figure out an alternative Apple Script that shows a dialog box with a confirm or cancel. That should work with just a working keyboard.
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #14 on: February 17, 2020, 04:35:23 PM »
yes, that´s how a reboot works.

but restarting the finder is something else than rebooting the OS. :)

Code: [Select]
try
tell application "Finder" to quit
end try
delay 5
tell application "Finder" to activate

I see where the confusion came from.
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #15 on: February 17, 2020, 07:43:36 PM »
i was just nitpicking the way you expressed it, for future reference. :P
insert arbitrary signature here

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #16 on: February 17, 2020, 07:48:58 PM »
When you say you reboot with the keyboard, how are you doing so without using the mouse cursor at all (other then what I do with the hot key).

just the normal keyboard command, which is command-alt-eject on every mac i know since 300 b.c.

you obviously missed that during the last 2320 years? :P

but as it seems we agree on all the other points. your approach is still an interesting contribution, so go on.
insert arbitrary signature here

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #17 on: February 17, 2020, 07:53:14 PM »
Very good point! I’m honestly not sure.

certain games might have a problem with that. or even 3rd party controlpanels/traps?

i believe most ego shooters make use of them. MM dreamwaver .. ? not sure now.

Quote
you could just turn off the Hot Function Keys from within the keyboard control panel after a successful boot.

you can probably even applescript that. :)
insert arbitrary signature here

Offline alexfree

  • Enthusiast Member
  • ***
  • Posts: 37
  • New Member
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #18 on: February 18, 2020, 05:07:19 AM »
When you say you reboot with the keyboard, how are you doing so without using the mouse cursor at all (other then what I do with the hot key).

just the normal keyboard command, which is command-alt-eject on every mac i know since 300 b.c.

you obviously missed that during the last 2320 years? :P

but as it seems we agree on all the other points. your approach is still an interesting contribution, so go on.

Yes I did miss that, thanks for letting me know. Just curious, since I don’t have an Apple keyboard, how would I do this? I don’t have an eject button.
Mac Mini G4 early 2005 - 1.42GHZ w/ 1GB RAM - Triple booting Mac OS 9.2.2, Mac OS X 10.3.9 & 10.4.11

Offline ovalking

  • Gold Member
  • *****
  • Posts: 210
  • new to the forums
Re: Tutorial : How To Set Up A Reboot Hot Key (For When The Mouse Bug Happens)
« Reply #19 on: February 18, 2020, 01:41:10 PM »
I'm not familiar with the MacMini mouse issue or Applescript.
However, I tried your tiny script. Saved it as an application and 'never show startup screen' checked.
Then navigated to and opened it via the keyboard (no need to play with F keys). My G3 gracefully shut down and restarted.
Could be useful if, for whatever reason, you have no mouse, or keyboard with a power button.