- 
      
- 
        Save elentok/6218781 to your computer and use it in GitHub Desktop. 
| #!/bin/bash | |
| # Open current directory in forklift | |
| echo -n $PWD | pbcopy | |
| (cat<<EOF | |
| tell application "Forklift" | |
| activate | |
| tell application "System Events" | |
| keystroke "G" using {command down} | |
| keystroke "v" using {command down} | |
| keystroke return | |
| keystroke return | |
| end tell | |
| end tell | |
| EOF | |
| ) | osascript | 
I've made two small changes:
- optional path argument
- does not use the clipboard anymore
Fork can be found here: https://gist.github.com/McNull/9779719
Thank you both for sharing!
You could use open -a Forklift . which opens the current folder in forklift.
In case you are having the same problem as I have:
Solved this this error:
Script Editor:
System Events got an error: Script Editor is not allowed to send keystrokes.
Need to add some (or all) of the following 'Security & Privacy' setting:
Goto:
  System Preferences -> Security & Privacy -> Accessibility
  System Preferences -> Security & Privacy -> Input Monitoring
Add:
  /System/Applications/Utilities/Script Editor.app
  /System/Library/CoreServices/AppleScript Utility
  /System/Library/CoreServices/System Events.app
  /usr/local/bin/bash
  /Applications/Setapp/ForkLift.app
Reference:
https://apple.stackexchange.com/questions/394275/com-automator-runner-xpc-is-not-allowed-to-send-keystrokes#
https://apple.stackexchange.com/questions/291574/osascript-is-not-allowed-assistive-access-1728
tags:
applescript-keystroke-permission
just in case somebody needs an updated version for Forklift 4.x
look here https://gist.github.com/therealmarv/4d6442593261e2776d75
Thanks for this script. I did a few modifications on my side:
echoline to use it in Automator (for creating a Service to launch from Finder).