* TinkerDifferent *
Retro Computing Community
Home | Forums | What's New | Search | Settings
Hacking FinderHack: CMD-DEL for System 7.1

Forums > Vintage Apple > Software & Operating Systems > Software | System Software (68k)

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Apr 13, 2024 - #1
10/23/2024 UPDATE:
@phipli ultimately provided the final solution: Use a scriptable Finder version 7.1.2, 7.1.3 or 7.1.4, install AppleScript 1.1, write the appropriate script, save as Application, then use Easy Keys to Assign the CMD-DEL keystroke. Perfect for System 7.1! (Start reading this post for details.)



Last night, I mentioned the need to hack FinderHack in my FaceBook post here in order to change its CMD-T keyboard shortcut the more commonly known and widely used CMD-DEL. The reason to use FinderHack is to bring the file-delete keyboard shortcut to System 7.1.



Matt Sephton (aka Gingerbeardman) chimed in with "CMD-DEL" hack that you can now download from the Garden, which is fantastic! The only thing left to do is to eliminate the bothersome confirmation dialog that appears when you select a file and then press CMD-DEL.

The author of FinderHack is Donald M. Brown, which interestingly enough was a programmer and founding partner of CE Software's QuicKeys. Who better, I thought, to eliminate that confirmation dialog box than the creator of FinderHack. I Googled like mad and found the following links to Donald:
  1. Personal web page (with an old email address) -- seems to have gone down in the last couple years.
  2. Blog site
  3. Linkedin (only Premium members can contact him)
  4. Twitter (not sure how to initiate contact these days)
  5. AppleInsider Forums (I sent him a message)
  6. YouTube (sadly, he never enabled his email address via Business Contacts)
I sent an email to the address mentioned on Don's personal web page, but it came back saying his inbox was full. That warning sign, combined with the fact his Blog site went down sometime after Feb. 2023 indicates he may have passed away only a year or two ago. Just like Paul C. Pratt, we have another valued member of the community who has possibly gone missing.

REQUEST FOR HELP: If any of you have ideas on how to HACK old Mac software, maybe you could chime in with a proposal about how to eliminate the confirmation dialog that appears after pressing CMD-DEL

Thanks!
Attachments:
1712971548245.png [View]

Liked by Zane KaminskiandNitram78

Volvo242GT
Tinkerer
Currently Duvall, WA
--------
Joined: Feb 7, 2022
Posts: 365
Likes: 204
Apr 13, 2024 - #2
[Image: Screen Shot 2024-04-13 at 1.23.14 AM.jpg]
Click on the new message icon in the lower right corner where it says "Messages", then type in his username. Should be able to get ahold of him that way. According to the Eamon Wiki page, he looks to still be alive.

Attachments:
Screen Shot 2024-04-13 at 1.23.14 AM.jpg [View]

Liked by JDW

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Apr 13, 2024 - #3
>> Volvo242GT said:
Click on the new message icon in the lower right corner where it says "Messages", then type in his username. Should be able to get ahold of him that way. Click to expand...

Unfortunately, it's not possible...

Attachments:
1713012338505.png [View]

Volvo242GT
Tinkerer
Currently Duvall, WA
--------
Joined: Feb 7, 2022
Posts: 365
Likes: 204
Apr 23, 2024 - #4
>> JDW said:
Unfortunately, it's not possible... View attachment 16206 Click to expand...
Hmmm, that blows.

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Apr 23, 2024 - #5
>> Volvo242GT said:
Hmmm, that blows. Click to expand...
Indeed. It blows like a thread with few replies! (I get antsy when few people reply to important threads.)

Thankfully, I am having an ongoing conversation with Gingerbeardman over on FaceBook, and he is proposing some solutions via KeyQuencer. We haven't gotten there yet, but if the work does work out, then I can post it here for all to read.

I actually much prefer this forum over FaceBook groups. You can post lots of test and inline pics here, whereas FaceBook doesn't lend itself to that. Even so, you've gotta go where the replies are, and that's what I do out of sheer desperation often times.

Liked by Volvo242GT

Opualuan
New Tinkerer
--------
Joined: Oct 10, 2024
Posts: 14
Likes: 5
Oct 21, 2024 - #6
I was able to make this work with a script in quickeys (slow) and keyquencer before I found Hidden Finder Features (but I use 7.5.5). I can look to see if my keyquencer script is still around, I don't think it was too complex.

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Oct 21, 2024 - #7
@Opualuan
Thank you for your suggestion.
Hidden Finder Features does indeed enable CMD-DEL, but only for System 7.5.2 through 7.6.1. The aim set forth in this thread is to find the best way to gain that CMD-DEL functionality in System 7.1.

phipli
Tinkerer
--------
Joined: Sep 23, 2021
Posts: 309
Likes: 215
Oct 21, 2024 - #8
If you only need it in 7.1 and later, you could do this with AppleScript, Finder 7.1.3 or 7.1.4 from System 7 Pro or System 7.1.2 (edited out an error where I said Finder 7.1.2 instead of the Finder versions from System 7.1.2) and... that thing that adds applications to the F-keys.

Finder 7.1.2 is a basically silent upgrade that adds compatibility with a few things like scriptable finder to System 7.1.

This is all that is needed once you have Finder 7.1.2 and AppleScript installed :



Save as an application and attach to a key combination. https://macintoshgarden.org/apps/easy-keys looks nice? I've not used it before.
Attachments:
1729499822503.png [View]

Liked by JDW

phipli
Tinkerer
--------
Joined: Sep 23, 2021
Posts: 309
Likes: 215
Oct 21, 2024 - #9
A couple of quality of life updates to stop you accidentally deleting the script itself, and handling nothing being selected.

This is still an extremely dangerous script because as requested, it doesn't do any confirmation before emptying the trash. I'd not actually run it like this myself and would comment out (place -- before the line) the "empty trash" line.



Edit - updated script screenshot for System 7 compatibility (counting selection doesn't seem to work for some reason, at least not how it did in Mac OS 8)

Edit Edit - changed "is" to "contains" so that you can't try to delete the script itself by selecting something else at the same time.
Attachments:
1729504284891.png [View]

Liked by JDW

phipli
Tinkerer
--------
Joined: Sep 23, 2021
Posts: 309
Likes: 215
Oct 21, 2024 - #10
Here is a demo of it in use on System 7.5.x (I don't have System 7.1 installed on my emulator, but it should work find as long as you have applescript and Finder 7.1.3 / 7.1.4 from System 7.1.2 (Edited out an error where I said Finder 7.1.2, instead of the Finder from 7.1.2).

The low framerate is missing most of the times I press delete sorry, but I am pressing it.

Attachments:
AppleScriptDelete.gif [View]

Liked by JDW

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Oct 22, 2024 - #11
I tried typing in your script manually (since the text of your script was not available). I merely left out "empty trash" because I don't need that. CMD-DEL in S7.5.5 works by merely casting your selection into the Trash without emptying the Trash.

Unfortunately, it won't compile and complains as follows:



I installed System 7.1 Pro exactly as I describe here:

After that, I installed AppleScript 1.0, which installs Script Editor 1.0.1.
Finder version is 7.1.4.

Please advise where I went wrong.
Thanks.
Attachments:
1729580652638.png [View]

phipli
Tinkerer
--------
Joined: Sep 23, 2021
Posts: 309
Likes: 215
Oct 22, 2024 - #12
>> JDW said:
Unfortunately, it won't compile and complains as follows: Click to expand...
>> JDW said:
Please advise where I went wrong. Click to expand...

That error looks like you don't have the normal scripting additions installed - they go in a folder in extensions.

>> JDW said:
After that, I installed AppleScript 1.0, which installs Script Editor 1.0.1. Click to expand...
Yeah, I wouldn't install 1.0 or anything if newer versions exist. I'd go for a bit newer than that. I'd install version 1.1 which is what I'm using. It should include the Scripting Additions folder in extensions, which will have a file called "Display Dialog" in it. Then that line will work.

>> JDW said:
Finder version is 7.1.4. Click to expand...
That's fine :) 7.1.3 or later is good.
>> JDW said:
I installed System 7.1 Pro exactly as I describe here: https://tinkerdifferent.com/threads/universal-system-7-1-2-68k-update-disk-set.2227/#post-33157 Click to expand...
To be clear, System 7.1.2 isn't System 7.1 Pro - 7.1 Pro is System 7.1.1. But, 7.1.2, what you've installed, I prefer because it doesn't install a load of extras that I don't use. I either use System 7.1.0 with Finder 7.1.3/7.1.4, or I just install the 7.1.2 update like you have.
Attachments:
1729584776083.png [View]

Liked by JDW

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Oct 22, 2024 - #13
@phipli
Thank you.
Sadly, there's still trouble.

I installed AppleScript 1.1 using these disk images. During the install, it told me that it would install an older version of the Finder. Not sure why AppleScript should even be replacing the Finder, but it did. It installed 7.1.3, overwriting 7.1.4.

These are all the files it installed:



Sadly, it still complains in the same way when I click the Check Syntax button:



You can download my *.dsk containing the System 7.1.2 install and AppleScript 1.1 here:


I boot that image using the Mini vMac MacII version.
Attachments:
1729586341504.png [View]
1729586380693.png [View]
mega.nz [View]
mega.nz [View]

phipli
Tinkerer
--------
Joined: Sep 23, 2021
Posts: 309
Likes: 215
Oct 22, 2024 - #14
>> JDW said:
It installed 7.1.3, overwriting 7.1.4. Click to expand...
Weird, but probably fine. I think it has decided you need at least 7.1.3, but doesn't realise that 7.1.4 meets the criteria.
>> JDW said:
These are all the files it installed: Click to expand...
Hummmmm

That isn't the usual AppleScript installer.

What about in the Extensions folder, did it install "Scripting Additions"?

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Oct 22, 2024 - #15
>> phipli said:
What about in the Extensions folder, did it install "Scripting Additions"? Click to expand...
Yes...

Attachments:
1729588742296.png [View]

phipli
Tinkerer
--------
Joined: Sep 23, 2021
Posts: 309
Likes: 215
Oct 22, 2024 - #16
>> JDW said:
Sadly, it still complains in the same way when I click the Check Syntax button: View attachment 18368 Click to expand...
You spelt "display" incorrectly ;)

Liked by OpualuanandJDW

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Oct 22, 2024 - #17
>> phipli said:
You spelt "display" incorrectly Click to expand...
Drat! You're right!


Please accept my humble thanks for spotting my typo!

All is well now. I can save it as an Application. But further testing will need to wait until tomorrow because my brain is thoroughly fried right now. o_O
Attachments:
1729594124519.png [View]

phipli
Tinkerer
--------
Joined: Sep 23, 2021
Posts: 309
Likes: 215
Oct 22, 2024 - #18
>> JDW said:
Drat! You're right! View attachment 18372 Please accept my humble thanks for spotting my typo! All is well know. I can save it as an Application. But further testing will need to wait until tomorrow because my brain is thoroughly fried right now. Click to expand...
Ah well, I make more typos than most. Especially when fighting auto correct on my phone.

Its worth checking around an error, before and after, when something like this flags up. Errors in code are notoriously cryptic on a good day, and just... well, wrong, other than the fact that there is an error, in many cases. Common example is that if you forget a line ending semicolon in C, you get an error on the next line that doesn't have anything to do with there not being a semicolon (because C doesn't see white space, it treats it like a weird concatenated line).

Liked by JDW

JDW
Administrator
Japan
--------
Joined: Sep 2, 2021
Posts: 2,534
Likes: 1,982
Oct 23, 2024 - #19
@phipli

Easy Keys works well to invoke the Application saved with AppleScript. CMD-DEL throws the selected file(s) in the Trash without emptying the Trash, which is perfect. I've not tested it on a real vintage Mac yet, but it works perfectly in Mini vMac (Mac II version).

By the way, I replaced Finder 7.1.3 (installed by the AppleScript 1.1 installer) with Finder 7.1.4 and rebooted. CMD-DEL still works. So I guess AppleScript isn't installing a modified Finder. It's just installing Finder 7.1.3 because it's "scriptable" and the installer didn't know about Finder 7.1.4 because it's too new so it prompts you to replace it. Interestingly, the filesize (byte size) is exactly the same when you compare those two Finder files. And I spent 20 minutes in ResEdit looking in vain for the differences. Anyway, the short of it is that you can use either Finder version without issue.

Thanks again!



For those of you following this thread who want to copy/paste the script, below is what you need (no typos either):

tell application "Finder"
    activate
    if (selection is not (empty)) then
        if name of selection contains (name of (info for (path to me))) then
            display dialog "You probably don't want to do that."
        else
            delete selection
        end if
    end if
end tell



UPDATE:
I tested on my Mac SE with WarpSE (25MHz 68000) installed, and it takes about 4-5 seconds before the thing you are deleting gets put into the Trash. So I suspect it would take even longer on the stock 8MHz CPU. Probably less time on an 030 or 040. Also keep in mind that AppleScript and EZ-Keys will eat 209kB of RAM. In other words, your CMD-DEL convenience requires 209kB at all times, even when you aren't using AppleScript or invoking anything with EZ-Keys. On Macs with more than 4MB, this won't matter. But 4MB Macs like the SE are RAM constrained, so it's an important point of consideration, over and above the amount of time required to throw your selected item into the Trash.

Liked by Opualuan

phipli
Tinkerer
--------
Joined: Sep 23, 2021
Posts: 309
Likes: 215
Oct 23, 2024 - #20
>> JDW said:
By the way, I replaced Finder 7.1.3 (installed by the AppleScript 1.1 installer) with Finder 7.1.4 and rebooted. CMD-DEL still works. So I guess AppleScript isn't installing a modified Finder. It's just installing Finder 7.1.3 because it's "scriptable" and the installer didn't know about Finder 7.1.4 because it's too new so it prompts you to replace it. Interestingly, the filesize (byte size) is exactly the same when you compare those two Finder files. And I spent 20 minutes in ResEdit looking in vain for the differences. Anyway, the short of it is that you can use either Finder version without issue. Click to expand...
Yes sorry, that is what I was saying above, sorry I wasn't clear. You just need Finder 7.1.3 or later - I didn't realise that AppleScript could install it, that is a nice free upgrade. Despite what many applications say in their readme, a lot of software that says it needs System 7.5.0 minimum will actually run on System 7.1 with Finder 7.1.3.

>> JDW said:
I tested on my Mac SE with WarpSE (25MHz 68000) installed, and it takes about 4-5 seconds before the thing you are deleting gets put into the Trash. Click to expand...
Hum, that is quite slow. I wonder if it is the application launching, or the control panel.
>> JDW said:
Also keep in mind that AppleScript and EZ-Keys will eat 209kB of RAM. In other words, your CMD-DEL convenience requires 209kB at all times, even when you aren't using AppleScript or invoking anything with EZ-Keys. Click to expand...
Do you know if the bulk of that is EZ-Keys? Or AppleScript. If it is EZ-Keys, alternatives are available. If it is AppleScript, given the functionality it adds is vastly beyond just what is being done here, that is sort of fair enough. Whatever method you do for this is going to involve extra software running in the background watching for key presses if nothing else. It will steal CPU cycles too. Have to admit I just drag things to the bin. I find the lack of Cmd-M, Cmd-D and Cmd-R more frustrating on early versions of System 7.

Page 1 of 2 | Next > | Last >>

Home | Forums | What's New | Search | Bookmarks | RSS | Original | Settings
XenForo Retro Proxy by TinkerDifferent.com