Launching a program with a switch

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
DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Launching a program with a switch

Post by DavJans » Thu Apr 16, 2015 10:10 pm

this is the EXE i need to run:
"C:\Program Files\Bar Tender 8.0\Bartend.exe" "F:\data\labels\SSCC01.btw" /P /XS

can it be done directly with a button or should I create a shortcut with the switch and tell livecode to run the shortcut?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

ChrisM
Posts: 24
Joined: Sat Mar 29, 2014 3:11 pm

Re: Launching a program with a switch

Post by ChrisM » Mon Apr 20, 2015 6:22 pm

DavJans wrote:this is the EXE i need to run:
"C:\Program Files\Bar Tender 8.0\Bartend.exe" "F:\data\labels\SSCC01.btw" /P /XS

can it be done directly with a button or should I create a shortcut with the switch and tell livecode to run the shortcut?

I do the same sort of thing, running command line from buttons with variables from a text field, took a bit of working out the commands. As far as I could work out, you need to break it up a little bit because of the quotes, so it would be something like:-

set the hideConsoleWindows to true
get shell("C:\Program Files\Bar Tender 8.0\Bartend.exe " & Quote & "F:\data\labels\SSCC01.btw " & Quote & "/P /XS")


You also need to be aware to build the spaces into command - the bit above might not be right, its just off top of my head :-)

Post Reply