|
|
#1 |
|
Triple-A Player
Join Date: Jul 2002
Location: Osaka, Japan
Posts: 59
|
get info on a folder/app/etc.
how do i do it? like when i right-click on an icon and select Get Info. just wondering how to do with terminal.
__________________
...and the soul still burns... |
|
|
|
|
|
#2 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
not sure what you mean
I'm not sure what you are wanting to do. Are you asking how you can use a command in Terminal to bring up the GetInfo box on some file? Or are you asking what command to use in Terminal to get textual info (inside Terminal) on a file or folder?
If the latter, you need to look at the command 'ls'. For example: ls -l or ls -l myfile |
|
|
|
|
|
#3 |
|
Triple-A Player
Join Date: Jul 2002
Location: Osaka, Japan
Posts: 59
|
simply open the GetInfo box. sorry that wasnt clear.
__________________
...and the soul still burns... |
|
|
|
|
|
#4 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
AppleScript maybe?
I don't know how to bring up the GetInfo window using a command in Terminal. This is a capability of Finder. But maybe there is a way to use AppleScript to ask Finder to do it. You can run AppleScripts from Terminal via the use of /usr/bin/osascript
|
|
|
|
|
|
#5 |
|
Triple-A Player
Join Date: Nov 2002
Location: germany
Posts: 178
|
this works:
osascript -e 'tell application "Finder" to open information window of folder "Documents" of folder "yourUsername" of folder "Users" of startup disk' sorry about the awful syntax, never understood path handling in AppleScript. still might be a starting point good luck markus |
|
|
|
|
|
#6 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
script to do it
Here's a Bourne shell script that seems to work.
Copy and paste it into a new file and make it executable with 'chmod' Code:
#!/bin/sh
# This script opens the Finder's "Get Info" window
# for the file or folder specified as a command-line argument.
scriptname=`basename $0`
if [ $# -lt 1 ]; then
echo "Usage: $scriptname file_or_folder"
exit
fi
path=$1
if [ ! -e $path ]; then
echo "$scriptname: $path: No such file or directory"
exit
fi
case $path in
/*) fullpath=$path ;;
~*) fullpath=$path ;;
*) fullpath=`pwd`/$path ;;
esac
if [ -d $fullpath ]; then
file_or_folder="folder"
else
file_or_folder="file"
fi
/usr/bin/osascript > /dev/null <<EOT
tell application "Finder"
set macpath to POSIX file "$fullpath" as text
open information window of $file_or_folder macpath
end tell
EOT
|
|
|
|
|
|
#7 |
|
Major Leaguer
Join Date: Jan 2002
Location: Adelaide, South Australia
Posts: 470
|
Nice script! There's a funky little companion script to this one at
http://forums.macosxhints.com/showth...cript+comments Just allows you to set comments from the command line, but the implementation might be worth a gander if anyone's interested in this sort of thing. At this rate we'll have all Finder possibilities replaced by CLI equivalents by, say, 2038. Cheers, Paul |
|
|
|
![]() |
|
|