New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
iOS and Apps All your questions and discussion of iOS or iOS Apps.

Making an interface to run a php file in Terminal


Post Reply New Thread Subscribe

 
Thread Tools
juniorj23

 
Member Since: Jun 09, 2012
Posts: 4
juniorj23 is on a distinguished road

juniorj23 is offline
i have created a script to run manually by dragging and dropping a file in terminal and hit enter and it would run. Is it posible to create a basic interface like a window pops up and all i do is click run and it will run the file, instead of dragging and dropping. thanks in advance.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,764
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is online now
Fire up the AppleScript Editor and paste in the following (adapted from this script):
Code:
set question to display dialog "Run script?" buttons {"Yes", "No"} default button 1
set answer to button returned of question

if answer is equal to "Yes" then
	do shell script "php <insert script name with path>"
end if
Replace "<insert script name with path>" with the full name and path of the script. Test it out and make sure it works.

When it works to your needs, go to File > Save As > File Format > Application and save it somewhere. The product will work like any other application - double click it, respond to the prompt and enjoy.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
juniorj23

 
Member Since: Jun 09, 2012
Posts: 4
juniorj23 is on a distinguished road

juniorj23 is offline
Quote:
Originally Posted by vansmith View Post
Fire up the AppleScript Editor and paste in the following (adapted from this script):
Code:
set question to display dialog "Run script?" buttons {"Yes", "No"} default button 1
set answer to button returned of question

if answer is equal to "Yes" then
	do shell script "php <insert script name with path>"
end if
Replace "<insert script name with path>" with the full name and path of the script. Test it out and make sure it works.

When it works to your needs, go to File > Save As > File Format > Application and save it somewhere. The product will work like any other application - double click it, respond to the prompt and enjoy.
Thanks bro thanks for your time
QUOTE Thanks

Post Reply New Thread Subscribe


« Where did I go wrong - iPhone Hotmail contacts? | Lost Security App IOS 5.1.1 »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Run bash script via button in interface builder? Bwoe OS X - Development and Darwin 5 03-23-2011 08:58 PM
Making the switch from PC to Mac - Terminal emulators? petenet OS X - Apps and Games 2 09-13-2010 01:56 PM
I just hid a file with Terminal, now i can't find it! Simbad54 OS X - Operating System 5 06-22-2007 07:26 AM
I'm using a windows pc, can the hqx file im making be read from a Line OS X - Apps and Games 0 11-12-2005 06:46 PM
Can you guys open this site? Desolate One OS X - Apps and Games 13 04-29-2005 01:23 PM

All times are GMT -4. The time now is 06:22 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?