Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

flashuni

macrumors newbie
Original poster
Hello, I currently have a working script, but I want it to browse for the shell script to run. For example when you open a file it usually opens up the browser. I want to make the browser below pop up asking for a shell script to run (See the pict below).

Here is a picture of what I am trying to do (But I am running leopard)
64181.jpg


Here is my code:
Code:
tell application "Terminal"
	activate
	do script "sh Ziper.sh"
end tell
end open
 
"choose file" is what you're looking for

I think "choose file" is what you're looking for. It's part of the Standard Additions extension. In Script Editor, open the window menu and select library. You should see the scriptable apps you have (you can add terminal if it's not there) and some extensions like "Standard Additions." Look under that in the user interaction section for more info about "choose file" and related classes. You can customize the window a bit if you want.

Anyway, here's an example that uses the code you provided:

Code:
tell application "Terminal"
	set myScript to (POSIX path of (choose file))
	do script "sh " & myScript
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.