Changing the screen resolution...

Ken Ray kray at sonsothunder.com
Fri Apr 7 17:38:43 EDT 2006


On 4/7/06 2:37 PM, "Peter Reid" <preid at reidit.co.uk> wrote:

>> I get the result:
> 
> /bin/sh: line 1: /Users/peter/Desktop/screen sizer/support/cscreen -x
> 1600 -y 1200 -s 1: No such file or directory

The problem is you have a space in your path that needs to be escaped. Try
this:

put "/Users/peter/Desktop/screen\ sizer/support/cscreen -x 1600 -y 1200 -s
1" into tCmd
get shell(tCmd)

Here's a general purpose function you can use to format paths for use with
Unix (and Windows for that matter):

function stsFormatPath pPath,pPlatform
  -- assumes a full "/"-delimited path
  switch pPlatform
  case "MacOSX"
  case "Unix"
    put "\" & space & quote & "'`<>!;()[]?#$^&*=" into tSpecialChars
    repeat for each char tChar in tSpecialChars
      replace tChar with ("\" & tChar) in pPath
    end repeat
    break
  case "Win32"
    set the itemDel to "/"
    put item -1 of pPath into tFile
    put "\/:*?" & quote & "<>|" into tSpecialChars
    repeat for each char tChar in tSpecialChars
      replace tChar with ("-") in tFile
    end repeat
    put tFile into item -1 of pPath
    replace "/" with "\" in pPath
    break
  end switch
  return pPath
end stsFormatPath

Have fun!

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list