Open a Smart Folder in Finder

Hey bdurham,

Ace has shown that you can go to town setting the Finder view with KM. You can set the menu-state. You can also detect the menu state, so you're macro can make choices based in the current set-up if desired.

Smart folders need not show up in your Finder window side-bar. They can be hidden in the "Saved Searches" folder, so you can have as many as you want without cluttering the Finder.

In this use-case I'd rather use AppleScript than a KM-specific action, because I have more control over what the Finder does. In the macro below I'm setting the bounds of the window (position & size).

Run this from Script Editor.app to see what it does. Run in KM with an Execute an AppleScript action.

# User changes this name to suit:
set smartFolderName to "Pending.savedSearch"

set smartFolderDir to ((path to library folder from user domain as text) & "Saved Searches:")
set smartFolderPathHFS to smartFolderDir & smartFolderName

tell application "Finder"
  activate
  open alias smartFolderPathHFS
  set bounds of front window to {525, 45, 1395, 817}
end tell

-Chris
_____________________
KM 7.0.1 on OSX 10.10.5