Is there a 'unmount device' macro?

thank you
good point. I think that the problem is the anti virus Bitdefender. Somehow, according to the documentation, the scanning process is linked to spotlight

Perhaps you can exclude that device from automatic scanning. You’d have to decide if it was worth it to you, of course.

1 Like

the problem is that everytime you eject a device, the exclusion configuration is excluded, even if you install another deivce with the same name.
thanks for your answer

1 Like

Hello Tom,
The macro works very well.
When I run the macro, I have to click inside the dialog box and pick the device i want to eject (99% of the time only one device).
Is there any way to end the macro by putting the cursor inside the box, so that I can use the up down arrows to pick the device to eject and press Enter?
thanks again very much

OK, try this:

List and Eject Disks [ver 2.1].kmmacros (2.3 KB)

It will now remember the previously ejected disk and preselect it in the dialog. If it’s the desired disk you can press OK, if not you can navigate with the arrows.
If the previously ejected disk is not available, it will select the first disk in the list.

tell application "Keyboard Maestro Engine" to set diskToEject to getvariable "previousDisk"
tell application "Finder" to set diskList to name of every disk whose ejectable is true
if diskList does not contain diskToEject then set diskToEject to first item of diskList
tell application (path to frontmost application as text) to set diskToEject to choose from list diskList with title "Eject Disk" with prompt "Select disk(s) to eject:" default items diskToEject with multiple selections allowed
if diskToEject is not false then
   tell application "Finder" to eject diskToEject
   tell application "Keyboard Maestro Engine" to setvariable "previousDisk" to diskToEject
end if
4 Likes

fantastic !! thank you very much !

tiny glitch: at the end, the following box is displayed

Probably it has nothing to do with the script. Seems that you have installed a Scripting Addition that is not compatible.

If the script runs fine, then set the option of the Execute AppleScript action to “ignore results”. (However you won’t see any error messages then.) Better: Update the incompatible Scripting Addition, or remove it from the path indicated in the message.

1 Like

thank you for your reply.

I don’t have the script addition app in question (24U Appearance OSAX).

Do you suggest I purchase it?

Could it perhaps be Bartender 2 which I purchased a month ago?

https://www.macbartender.com/

I once got an error message containing the word OSAX

------- Console Output -------

Sep 14, 2016, 13:38:16 Bartender 2: SecStatucCodeCreateWithPath() error for file:///Library/PrivilegedHelperTools/com.surteesstudios.Bartender.BartenderInstallHelper: -67068
Sep 14, 2016, 13:38:28 kernel: Sandbox: ditto(1949) System Policy: deny(1) file-write-create /System/Library/ScriptingAdditions/BartenderSystemHelper.osax

Can’t suggest to purchase it, because I never heard of that Scripting Addition before :wink:

Have you looked into the indicated folder?
~/Library/ScriptingAdditions/

(Your message clearly says that there is something.)

Maybe you have installed a demo version long time ago.

Could it perhaps be Bartender 2 which I purchased a month ago?

I don’t think that it is related.

1 Like

you are incredible !

I found the folder below as you had predicted

what should I do ? thanks !

First: I predicted nothing. The message window you have posted before has “predicted” it :wink:

Second: You are in the wrong folder. You are in…

/Library/ScriptingAdditions/

This is the global Scripting Additions folder, which is not the one you need.

Look again at the message: it tells you the correct folder:

/Users/jlette111/Library/ScriptingAdditions/

This is the User’s Scripting Additions folder und you’ll find the offending “24U Appearance OSAX.osax” there.

To open that folder…

  1. copy the path from here /Users/jlette111/Library/ScriptingAdditions/
  2. go to the Finder
  3. press ⇧⌘G
  4. paste the path into the text field of the sheet
  5. click OK.

…and then…

what should I do ?

…delete the “24U Appearance OSAX.osax” if you don’t need it. (Or try to get an update if you want to keep it.)

1 Like

thank you for the clear and detailed instructions which I followed.

Hey Ronald

This AppleScript will provide a complete report of all installed OSAXEN.

Osax Report.scpt.zip (9.3 KB)

The 24U Appearance OSAX was a great scripting addition, but it has not been well supported in the last few years. (I don't like the way v4.x phones-home either.)

Default Folder 5 no longer relies on the Default Folder X Addition.osax.

The SIMBL.osax is not something you should have on your system, unless you know what requires it. It allows code-injection into apps, and theoretically is a serious security threat. I reluctantly stopped using utilities that required it several years ago for that reason and because it made my system a little less stable.

-Chris

2 Likes

Thank you. I deleted it, and thanks for the apple script

Thank you very much for the script. This is the result. What should I do now? I could delete textexpander which would be a pain because I have a library of snippets. That being said, I trust your advice

INSTALLED OSAX REPORT 2016/10/21 14:07


System Domain Osaxen

/System/Library/ScriptingAdditions/

Digital Hub Scripting.osax
StandardAdditions.osax


Local Domain Osaxen

/Library/ScriptingAdditions/

Adobe Unit Types.osax
Default Folder X Addition.osax
SIMBL.osax


User Domain Osaxen

~/Library/ScriptingAdditions/

TextExpander Addition.osax


/System/Library/ScriptingAdditions/ → Leave this folder as it is. These Additions are installed by macOS
Digital Hub Scripting.osax
StandardAdditions.osax

/Library/ScriptingAdditions/
Adobe Unit Types.osax → Installed by Adobe products. Check the version of the .osax (Finder Info), it should be 2.1.0. If it’s older then update it.
Default Folder X Addition.osax → See Chris’ (@ccstone) post above.
SIMBL.osax → Ditto.

~/Library/ScriptingAdditions/
TextExpander Addition.osax → Keep it if you’re using the Textexpander app.

I could delete textexpander which would be a pain because I have a library of snippets.

I think nobody has said you should delete Textexpander.

1 Like

thank you

your help was invaluable. thanks so much for the applie script.

Thanks Tom! That is so awesome!!

Thanks for the feedback. Me too, I’m happy with the script :wink:

For a maximum of convenience you can map the trigger to the Media Eject key of your keyboard (⏏) as shown in one of the posts above. (I have not included that trigger in the downloadable macro because that key is probably device-specific.)

But: If you are going to map it to the ⏏ key, then I recommend to not do it as I have shown it in the post above: Instead of selecting “ignoring modifiers” I recommend to select “with these modifiers” with no modifier key selected. Like this:

The reason is, with that trigger you are still able to use the other, system functions of the ⏏ key. (The system functions of the ⏏ key are described here.)