Browse the docs

finderInsertionLocation

Returns the folder Finder would put a new item in.

Keyboard Maestro: FinderInsertionLocation

Details #

finderInsertionLocation() takes no arguments and returns the POSIX path of Finder's insertion location: the folder of the front Finder window, or the Desktop when no window is open.

Parameters #

Takes 0 arguments. {{ finderInsertionLocation() }}

Examples #

finderInsertionLocation()
→

Gotchas #

  • It asks Finder through Automation, so Switchboard needs permission to control Finder. If that is denied it returns empty text.

  • Calling it with any argument is an error: finderInsertionLocation() takes 0 arguments, got 1.

  • When no real Mac is behind it (tests, previews) or the Mac can't answer, it returns empty text.