![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Maintain full path of a script in a var when sourcing it from a different script | mrbluegreen | Shell Programming and Scripting | 4 | 03-19-2008 06:31 PM |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 11:31 AM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 12:06 AM |
| here document to automate perl script that call script | hogger84 | Shell Programming and Scripting | 3 | 10-22-2007 07:15 AM |
| check in unix shell script so that no one is able to run the script manually | adi_bang76 | Shell Programming and Scripting | 1 | 11-16-2006 06:43 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
help with preflight script
I'm trying to make a preflight script to determine the best install location for my software. So far, the script finds all possible locations and stores them in an array (it's a bash script, BTW). Now what I need to do is prompt the user to choose from the list that's been assembled and then assign the selection to the correct variable. I'm assuming that will require osascript, but that's where I get lost. I know barely anything about Applescript, so I could use some help here:
Code:
osascript <<-EOF
tell application "Finder"
display dialog "Choose an install location: ...
# insert code
i=0
for file in ${list[@]}; do
echo ${list[i]}
let i++
done
# end code
... " default answer "1" buttons {"Continue"} default button 1
end tell
EOF
1) Some working osascript code, and 2) How I would capture the user's selection and interpret it? |
| Forum Sponsor | ||
|
|
|
|||
|
in your script
cat (contents of array) echo "Make a selection :\c" read selection read will asign the location they type to call it back, to do somthing with it use $selection say you wanna save it in an external file within the script file=$/usr/yourname/newfilename echo "$selection" >> $file btw this is bash... not sure if it will work but figured i mention it |
|||
| Google UNIX.COM |