Problems With Macro Icons in Keyboard Maestro Version 9.1

Ok, it works in Sierra too.

On both Catalina and Big Sur, I can screen capture an area and then paste it in without issues.

So perhaps it depends on the image you are copying.

Yes, drag & drop is no longer supported (at least at this time).

1 Like

I am able to copy and image (like in a web browser), and then paste into the Macro icon image well. Running Keyboard Maestro 9.1 on macOS 10.14.6 (Mojave).

Hi all

Can someone explain how to actually use the copy/paste method to change a macro icon? I can't seem to understand how to do so from finder. the only thing that seems to work is copy/paste from a webpage..I assumed we can also copy paste from a local image right?

best

Z

Yes, I've just double-checked and pasting from the clipboard does work and as @peternlewis says, drag and drop no longer works. Hopefully drag and drop will be re-enabled at some point as drag and drop was the way I was doing it.

Before I could just drag a .png file from the Finder into the Macro's Image Well. Now the .png has to be opened (for example in Preview) and then ⌘A to select all of it, then ⌘C to copy it, before ⌘V to paste into the Image Well of the Macro.

Actually, just thinking it would be pretty simple to make a Keyboard Maestro Macro to automate these steps... :slight_smile:

1 Like

As in my previous post but in exact steps:
Open the image file in Preview
⌘A to select all of it
⌘C to copy it
Click on the current Icon of the Macro you want to change
⌘V to paste in the new Icon

Before, the .png could be dragged from the Finder directly into the Macro but as of now this is not working.

2 Likes

When I copy an image in my web browser I can copy and paste it. When I copy and paste the same image on the desktop, this happens:

2020_11_23_Support_2

Why so cumbersome @peternlewis? It worked wonderfully in the previous KM version.

1 Like

For anyone who might find it useful, here is a simple Keyboard Maestro Macro that opens the selected Image File in Preview (after it is selected in the Finder), selects all of it and copies it to the Clipboard - ready for pasting into the Image Well in any Keyboard Maestro Macro.

I agree with @appleianer that it would be nice if the previous ability to be able to drag a file from the Finder straight into the Image Well was reinstated in Keyboard Maestro. But until then, this little Macro makes the process quite fast. I just call it up by clicking on my Keyboard Maestro Finder Palette. But it could also be given a Hot Key.

Icon to Clipboard.kmmacros (21.0 KB)

3 Likes

Thanks for the tip @Zabobon :+1:

I have your macro for me somewhat extended, so that I get the image from the Finder directly inserted.
I have taken into account that there are different base icons for macros and macro groups.

2021_01_12_Support_1

06)Icon KM <C892 210112T165239>.kmmacros (25,9 KB)

06)Icon KM <C892 210112T165239>

Since I individualize many icons in Snagit 2021 or also fetch them via the browser (Safari), I have also created macros for it :wink:

2 Likes

That is great @appleianer and I was thinking it would be good to automate the whole process...

...but I have just discovered something, by playing around, that will make the whole process even smoother:

When a Macro is selected, pressing the Tab Key once highlights the Icon Well and from that point a simple Paste Action will paste in the Icon that is in the Clipboard.

I will add this on to my Macro and see if it works...

1 Like

Yes - just tested it and it works!

I think this is a good way @appleianer as I mostly want to change the icons of existing Keyboard Maestro Macros and the "Find Image" solution would only work with the initial Keyboard Maestro Icons - once a Macro is edited Keyboard Maestro changes the Icon to a range of other Icons.

This new Macro will paste into the Image Well of the Macro no matter what its existing Icon is.

Icon to Keyboard Maestro.kmmacros (23.3 KB)

2 Likes

Brilliant idea @Zabobon :star_struck:

I had already thought about how to get this to work. I added tab input to my macros.
It works great :+1:

1 Like

Hey Guys,

Is it no longer possible to get the icon of a file/app from the Get-Info window in the Finder?

That traditionally has been the easiest method.

  • Select the file/app you want in the Finder.
  • Make sure the macro you want to paste into is open in the Keyboard Maestro Editor.
  • Run the script IN the Finder.

Since it uses System Events it might require tweaking to work on versions of macOS later than macOS 10.12.6 Sierra.

But it should be waaay faster than using Preview.

-Chris

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2021/01/13 02:01
# dMod: 2021/01/13 02:09
# Appl: Keyboard Maestro, Finder, System Events
# Task: Copy the Finder Icon from the Selected File or App
#     : to the Image Well of the Keyboard Maestro Editor.
# Libs: None
# Osax: None
# Test: Only on macOS 10.12.6 with Keyboard Maestro 9.2
# Tags: @Applescript, @Script, @Finder, @Keyboard_Maestro, @System_Events
# Vers: 1.00
--------------------------------------------------------

try
   
   tell application "System Events"
      tell application process "Finder"
         tell menu bar 1
            tell menu "File"
               tell menu item "Get Info"
                  perform action "AXPress"
               end tell
            end tell
         end tell
         
         delay 0.1
         keystroke tab
         delay 0.1
         
         tell (first window whose subrole is "AXStandardWindow" and name ends with "Info")
            tell scroll area 1
               tell image 1
                  set focused to true
               end tell
            end tell
            
            keystroke "c" using command down
            delay 0.1
            
            tell (first button whose subrole is "AXCloseButton")
               perform action "AXPress"
            end tell
            
         end tell
         
      end tell
      
      if first item of (first item of (get clipboard info)) is «class icns» then
         
         tell application process "Keyboard Maestro"
            set frontmost to true
            tell (first window whose subrole is "AXStandardWindow" and name starts with "Keyboard Maestro Editor")
               tell group 1
                  tell splitter group 1
                     tell scroll area 3
                        tell image 1
                           set focused to true
                        end tell
                     end tell
                  end tell
               end tell
            end tell
         end tell
         
         delay 0.1
         keystroke "v" using command down
         
      end if
      
   end tell
   
on error e number n
   set e to e & return & return & "Num: " & n
   if n ≠ -128 then
      try
         tell application (path to frontmost application as text) to set ddButton to button returned of ¬
            (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
               default button "OK" giving up after 30)
         if ddButton = "Copy Error Message" then set the clipboard to e
      end try
   end if
end try

--------------------------------------------------------

Unfortunately not anymore @ccstone.

In the current version of macOS Catalina and macOS Big Sur, drag & drop or copy & paste no longer works.

2021_01_13_Support_1

To answer it in your words @ccstone:

If you read the article carefully and are not up to date with the macOS operating systems... is unnecessary in the future such a demand.

Ha! I did read the thread carefully, and this is hardly clear.

-ccs

Hi @appleianer - I know this thread is a year old but as I still miss being able to drag and drop an image file into a Macro's Icon Image Well, I've been using the Macro idea we came up with above (first opens the selected image in Preview, selects all, closes Preview etc). But suddenly today I realised a much simpler one Action solution to get the image from the Finder's Selected Image File (for example a .png file) into the clipboard ready to paste into Keyboard Maestro:

40)Icon to Clipboard for KM 2022.kmmacros (16.4 KB)

Click to show image

40)Icon to Clipboard for KM 2022

1 Like

@Zabobon thanks for sharing :+1:

Your solution is really better than the detour via the preview app. I have extended your macro a bit. The prerequisite is that you select the macro in the KM Editor before starting it (blue).

2022_02_07_Support_1

04)Icon KM <94D2 220207T163512>.kmmacros (22,8 KB)

Click to show image

04)Icon KM <94D2 220207T163512>

2 Likes

Great! And not only have you made the whole Macro but also your usual nice video demo :slightly_smiling_face:

1 Like

@Zabobon, who has missed the English lessons in school, which expresses itself just in moving pictures :rofl:

The thanks go to you for the improvement of the macro.

1 Like