use of terminal commands OSX

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
KevinPy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 6
Joined: Fri Mar 15, 2013 10:44 pm

use of terminal commands OSX

Post by KevinPy » Thu Apr 11, 2013 9:38 am

Hi everyone,

I'm a new to LiveCode, and i try to build a little app for OSX, based on terminal commands.
I try to create a "purge" script, but i don't know very well the language.

On Terminal, the command is simple: purge (What else ?)
But on LiveCode, i create a button, with this code:

on mouseUp
shell("purge")
set the shellCommand to "purge"
end mouseUp

I try two shell commands, but does not work.

Thanks you in advance for you help.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: use of terminal commands OSX

Post by jmburnod » Thu Apr 11, 2013 9:59 am

Hi kevinPy,

I don't use shell but i know

Code: Select all

get shell("say" && "Welcome in this forum Kevin")
works
I hope this help
Best regards

Jean-Marc
https://alternatic.ch

KevinPy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 6
Joined: Fri Mar 15, 2013 10:44 pm

Re: use of terminal commands OSX

Post by KevinPy » Thu Apr 11, 2013 11:18 am

thanks, it works.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: use of terminal commands OSX

Post by Klaus » Thu Apr 11, 2013 11:44 am

Hi Kevin,

yes, Jean-Marc is right, SHELL() is a function so you need to:
1. GET shell("...")
## now IT contains the returned value, if any...
or
2. PUT shell("...") into Some_Var
:D


Best

Klaus

KevinPy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 6
Joined: Fri Mar 15, 2013 10:44 pm

Re: use of terminal commands OSX

Post by KevinPy » Thu Apr 11, 2013 1:36 pm

OK, I understand. Since I participated in the financing Kickstarter, I have access to tutorials, and I think I make a day or two discovery software.

Post Reply