Results 1 to 3 of 3
  1. #1
    Making an interface to run a php file in Terminal

    Member Since
    Jun 09, 2012
    Posts
    4
    Making an interface to run a php file in Terminal
    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.

  2. #2
    Making an interface to run a php file in Terminal
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,395
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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

  3. #3
    Making an interface to run a php file in Terminal

    Member Since
    Jun 09, 2012
    Posts
    4
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mac terminal run a file of commands
    By ilan in forum OS X - Operating System
    Replies: 4
    Last Post: 09-30-2012, 06:16 PM
  2. Run bash script via button in interface builder?
    By Bwoe in forum OS X - Development and Darwin
    Replies: 5
    Last Post: 03-23-2011, 08:58 PM
  3. Anyone help me figure out why php won't run even though I'm using MAMP
    By zipsfan21 in forum Web Design and Hosting
    Replies: 4
    Last Post: 02-08-2011, 06:58 PM
  4. Terminal. Making a .rar
    By Frattimonde in forum OS X - Apps and Games
    Replies: 0
    Last Post: 01-20-2008, 07:09 AM
  5. Making The Mac Talk Via Terminal
    By arai_speed in forum Switcher Hangout
    Replies: 14
    Last Post: 02-13-2007, 06:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •