Using Shell Command to Run ImageMagick-- Silently

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rontoledo
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 11
Joined: Fri Jan 09, 2009 6:51 am

Using Shell Command to Run ImageMagick-- Silently

Post by rontoledo » Fri Jan 09, 2009 6:59 am

Hello there. In Windows, using RunRev's Shell command, I've been able to run ImageMagick via command line to perform a simple image conversion:

on mouseUp
put "convert c:\aPicture.jpg c:\aPicture.png" into switchCommand
get shell (switchCommand)
end mouseUp

Btw, I also tried:

on mouseUp
put "c:\imagemagick\convert.exe c:\aPicture.jpg c:\aPicture.png" into switchCommand
get shell (switchCommand)
end mouseUp

Both successfully converted the image. However, whenever I press the button to drive ImageMagick, the black Windows command line window appears for a split-second (on top of the RunRev stack), and then disappears.

Is there a way to either suppress or hide the Windows command line window, so that the user never sees it?

Thank you in advance,
Ron Toledo

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

Post by Klaus » Fri Jan 09, 2009 9:17 am

Hi Ron,

just add this line:

Code: Select all

on mouseUp 
  ## This one:
  set the hideconsolewindows to true

  put "convert c:\aPicture.jpg c:\aPicture.png" into switchCommand 
  get shell (switchCommand) 
end mouseUp
Best from germany

Klaus

SparkOut
Posts: 2949
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Fri Jan 09, 2009 9:17 am

Before you call the shell command, use the instruction:

Code: Select all

set the hideConsoleWindows to true
and... well, you can work out what it does ;)


[edit]Nice simulposting Klaus![/edit]

rontoledo
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 11
Joined: Fri Jan 09, 2009 6:51 am

Post by rontoledo » Sat Jan 10, 2009 12:55 am

Wonderful!

Thank you both very much. I'm a ColdFusion developer, and have committed to learning Revolution as a new language. I continue to be wowed by Revolution's elegance, and this forum and your support makes it even better.

Have a great day,
Ron

Post Reply