The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > OS X (Apple)
Google UNIX.COM
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-2004
Registered User
 

Join Date: Jun 2003
Posts: 20
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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
I know I could do this through a select statement, but I'd rather use the user-friendly Finder for this (that's the whole purpose of making this installer). Could someone give me an example of:

1) Some working osascript code, and
2) How I would capture the user's selection and interpret it?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-01-2005
Registered User
 

Join Date: Jan 2005
Location: State College, PA
Posts: 12
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 02:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102