Get Info of a hidden file (to change its default app)
You can use the following shell function. This uses open information window which is much better than GUI scripting or keyboard shortcut scripting which relies on the file shown in Finder.

si() {
    osascript - "$@" &lt;&lt;-END &gt; /dev/null 2&gt;&amp;1
    on run args
    tell app "Finder"
    activate
    repeat with f in args
    open information window of (posix file (contents of f) as alias)
    end
    end
    end
    END
}


Source: https://superuser.com/a/509080/

Run with

si /path/to/file