Jump to content

Is it possible pass Path Finder selection to a script?


Recommended Posts

I recently switched from Total Finder to Path Finder. Total Finder adds improvements to Finder, so it doesn't affect applescript usage. 

 

Because Path Finder is its own application that has limited applescript support, my old workflow doesn't work anymore.

The old workflow opens current Finder selection in an application based on user input ( Alfred File Filter ).

 

This is what I've been able to gather: 

 

I was thinking that since Alfred is able to get the selected files from Path Finder and pass them on to a File Action, it's possible that maybe there's a better way to do this workflow?

It's important that I can use the workflow by pressing hotkeys and writing in the application name.

 

My old workflow:

  1. Hotkey
  2. File Filter ( for applications in the Applications folder )
  3. Run Apple script:
    tell application "Finder"
    	open (get selection) using path to application "{query}"
    end tell

     

 

My new workflow works with Path Finder (barely):

  1. Hotkey
  2. File Filter ( for applications in the Applications folder )
  3. Run Apple script: 
    -- Shortcut to trigger Path Finder method File > Reveal in Finder. It retains the selection.
    tell application "System Events"
        key code 3 using {option down, command down}
    end
    
    delay 1.2
    
    tell application "Finder"
    
    	set selectedFiles to (get selection)
    	close every window
    	quit
    	open selectedFiles using path to application "{query}"
    	activate application "{query}"
    	open
    	
    end tell

    So yea. this works, but it's not very ideal...

Edited by joonas
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...