Locate in Finder

    Apr 25 2014 | 9:14 pm
    Hello everybody,
    Some Mac applications have a "Locate in Finder" button which opens a Finder window and selects a given file. Does anybody know if there is there a way to achieve something like this in Max?
    If it was cross-platform that'd be even better (of course by replacing the Mac Finder with the Windows equivalent... ;)
    Thanks, Daniele

    • Apr 25 2014 | 10:47 pm
      It's probably not working on windows, but you can do something close with a few objects on mac. The patch show the folder which contains the file you want to see in the finder:
    • Apr 25 2014 | 11:33 pm
      and place a [tosymbol] between regexp and ;max message to allow for spaces in filepath name
    • Apr 26 2014 | 12:41 am
      Thanks to both of you for the useful tips. This solves the folder opening, but not the file selection (at least on my machine)... Is there maybe a way to achieve also this last bit?
      For instance: is there a way to run applescripts within Max? I was hoping to run an applescript with [shell] – say like this:
      where the applescript is something simple, like
      on run argv set thePath to POSIX file (item 1 of argv) tell application "Finder" to reveal thePath end run
      This script works perfectly from the Terminal command line, but it doesn't work with [shell]. Does anybody know why?
    • Apr 26 2014 | 1:06 am
      Yeah, just a matter of escaping double quotes, and everything works! For instance:
      osascript \"/Path/To/My/File/revealfile.scpt\" \"/Applications/Max 6.1/examples/sounds/drumLoop.aif\"
      Thanks guys!
      It seems that applescript via [shell] is the way to go, at least for my case.
    • Apr 26 2014 | 1:20 am
      Actually, as a final remark, one should also addtell application "Finder" to activate at the end of the apple script, to bring the Finder to the front.
    • Apr 26 2014 | 11:29 am
      You can call reveal directly without a script (and enjoy string escaping hell ;-):
    • Apr 26 2014 | 1:08 pm
      Cool, thanks ;)
      (Does anybody have any idea of how to possibly export this into Windows? Is there something similar to "applescript"?)
    • Apr 26 2014 | 8:47 pm
      yes indeed. there's vbscripts or batch files even executeable without shell object with max launchbrowser message. i'm currently playing around on both sides mac/win. i once made this to open explorer and select the file. it's from an old device and i didn't test it again, but you can see how to execute a shell command on windows without 3rd party external. vbscript can do similar things like applescript, but of course, uses more cryptic syntax.
    • Apr 26 2014 | 10:29 pm
      Thanks a lot, very helpful!