Hi! I try to do the thing this way (screenshots). But nothing happen on hot key pressing. The thing does work with Automator (that is selection goes "from Finder", while ForkLift is in use).
What is the way?
Well, and it does work in Finder if it does matter....
Is Forklift the front most application when you click the trigger?
Available in these applications is different from Available when these applications are running. The former works when Forklift is in front. The later works whenever Forklift is running.
Change the Forklift Group to **Available when these applications are running and try it.
Otherwise, you may have to clarify exactly what you are a trying to do.
Yes, of course, the ForkLIft is the front as far as I select some file in it.
I have changed the macro group to work for all apps/windows.
And I have found a reproducible way to isolate the problem:
- Open (the only) Finder window, check the macro does work (it does)
- Go to ForkLift, check the macro does work (yes, it does!!)
- Go to the only Finder window and close it
- Return to ForkLift - the macro stopped working
(the last Catalina is in use)
Using your explanation For #3 - If the Finder is closed, nothing is selected. So IMO, nothing should open if nothing is selected.
Maybe I’m missing something.
Ah, I was trying to select the same file in ForkLift. Yes, point 3 dosen't work, just Finder selection is opened in editor even when Finder window is not active.
So we returned to the starting point on finding the way to open a file selected in ForkLift.
You discuss three applications in your example... Sublime text is in your example screenshot, Finder and Forklift. Does Sublime Text have any reason to be in this discussion?
The way your macro shows is that when using ForkLift, if you press option-1, it will open the selected file (which in Finder) using Sublime Text. I can clearly see that.
If that's not what you want, you should explain exactly what you want.
Do you want your selection within ForkLift to open in Sublime Text??? If so, please state that.
Also, please post your macro here.
Yes, you are tight, Sublime Text can be replaced with any other app in our context.
As for using Finder selection... Well, this trick does work for Automator (screen shot is attached). I don't know internal mechanics, but guess ForkLift translate some kind of information to system regarding it's selected items.
Apparently this trick doesn't work with KM.
Also have tried via menu item action, but the way is File-> Open with -> Other.. with opening apps list. Not sure KM is able to handle such scenario.
Got it. Try the below and let me know if it works for you.
I don't have Sublime Text but the below works for Preview. Just change the Open with area where Preview is and change it to the application Sublime Text or whatever you need.
Open File in Preview.kmmacros (3.0 KB)
The trick is to copy the path somewhere (in this test the clipboard). If you don't need to store the variable longer, I'd suggest you Set the variable as Local_filepath and open the variable in %Variable%Local_filepath%. I didn't want to confuse you though.
Had to Modify the macro to add a delay and to clear the variable.
Great new way, thanks! Unfortunately, it works rather magically: it opens previous selection, and after closing an editor and reactivating hot key it opens current selection. As if some "flush" command is expected somewhere in the chain.
Also multiselection demands some clipboard buffer processing to replace EOLs with spaces, I guess.
I updated it, were you able to try it?
Yes, a pause has helped, thanks!
So the only issue remaining is to replace EOLs with spaces (I have tried to paste clipboard content resulting from multiselection into text file, and every item is placed on it's own row). Has KM got some kind of such transformation possibilities?
Ok whew! We got you through the main issue. You should create a new topic for the other one - that why it's easier for folks to search the new topic.
I will. Newbie new topic limit is exhausted at the moment.