Keyboard Maestro refuses to open .zip when dropped on the icon

Hi Everybody: here is a dumb question. I downloaded a zip file from the forum but Keyboard Maestro bips and does not open the file. (the file comes from this forum Path of front document in named application.zip (7.3 KB)

In the past, I had no problem passing zip file to KM. I downloaded a few more, but same problem. Did I do something wrong to be punished in such fashion?

Also another question:
To get the frontmost document name of nvALT 'everybody' says that (in Applescript) this should do the trick:
> tell application "System Events" to tell process frontApp -- frontApp is Nvalt

  	set p to value of text field 1 of group 1 of toolbar 1 of window 1

Yet when I run it "p" is empty and I get a message of error.

I would really appreciate your Help.
Good day
Jeando

El Capitan 10.11.6
Keyboard Maestro 7.3.1
nvALT 2.2.7 (126)

You have to have the Keyboard Maestro editor running, then drop the zip file on the KM icon in your Dock.

Probably you have forgotten to set the variable frontApp. This works for me:

tell application "System Events"
  tell process "nvALT"
    set p to value of text field 1 of group 1 of toolbar 1 of window 1
  end tell
end tell

Hello,
this is strange because I did not. I checked and ran directly your code to get this message: “System Events got an error: Can’t get window 1 of process “nvALT”. Invalid index”.

Thank you. It is night here. I will see tomorrow morning
Jeando

Thank you Dan Thomas, but yes I have the Keyboard Maestro editor running, and when I drop the file on the KM icon in the Dock, it fails…
Strange…
Good night

I have tested it with nvALT 2.2b (111). I will test it with a more recent version later.

What version of KM are you running? What version of OS/X?

I tried your file on my machine, and it worked. It can also be installed manually. I’ll tell you how, but let’s make sure this isn’t a version issue first.

That error comes up when nvALT is running but the Notes window is closed. Add a line at the beginning to make sure the Notes window is visible:

tell application "nvALT" to set visible of window "nvALT" to true
tell application "System Events"
  tell process "nvALT"
    set p to value of text field 1 of group 1 of toolbar 1 of window "nvALT"
  end tell
end tell

I have also replaced window 1 with window "nvALT" (line 4), because otherwise it would fail when the Preview window is frontmost.

(Tested with nvALT 2.2.7 (126)).


Here as KM macro:

_[test] nvALT Note Title.kmmacros (1.9 KB)

Hello Tom: first despair then JOY
And thank you again for looking into this.

First try:
nvALT is running, the Notes window is open, and it does not work either with the preview window open or closed.

But then, I closed nvALT and re-opened it and it works now with your new code! (It is your idea that solved the problem because I did restart nvALT yesterday about 5 times without effect).
Thank you a thousand times.
Jeando

Hi Dan Thomas,
I am running
El Capitan 10.11.6
Keyboard Maestro 7.3.1
nvALT 2.2.7 (126)

Just curious - how do you know that dragging the icon didn’t work? It doesn’t give you any messages when it works. But the Custom Action becomes available when it works. Have you tried to see if the action was added?

Hi Dan Thomas, I was alerted to the problem by the sound that immediately followed the dropping of the zip file.
Yes, I have searched for the action (five times to be on the safe side) in the KM Editor. I have repeated the process {dropping the zip, then searching for the macro} without avail. Normally it should be visible, but it is not in the list of all the macros! Should I look elsewhere?
I am importing Macros to see how they are constructed. I found it saves me a lot of time understanding how Applescript works when looking at how you gurus solve problems that I am faced with.

Weird.

Look also in ~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Actions. After dragging the Zip to the Dock icon the action should be extracted to that folder.

If there is already an old version of that action, remove it (the folder with the name of the action) and try again.

Hi Tom. I am wondering if it could be my Mac that is playing tricks on me (for the moment I cannot drop a zip file in KM). This afternoon, your code to get the name of the frontmost window in nvALT runs in Script Debugger but not from KM… I decided to leave the Mackbook pro for a while and transfer my work on the Imac to see if I get the same weird behavior.

Hi Tom, I can't believe it: there is one instance of all the zip file that I have tried to drop these last two days on the KM app. Why is it that I cannot find them in the list of macros?

I feel so stupid now! I imported “Actions” and not “Macros”. Of course they are in the Actions-List and not in the Macros-List. I am sorry to have bothered you with my inaptitude.

1 Like

@peternlewis is it safe to sync this folder w/ symlink or alias through dropbox etc?

Not while Keyboard Maestro is running.

That said, they probably change so infrequently that it would not be a problem, but the changes may not be noticed until you relaunch the Keyboard Maestro editor and engine.

1 Like