Screencapture shell script failure...noob
Hi, I'm trying to make a shell script which runs periodically and saves a file with a number appended to it. In order to increment the appended number, I'm saving the mycount variable to a file which is then read in (text file which just stores the number). The file path is pieced together with $mypath $fileName $mycount $fileExt. When I run screen capture from the command line in terminal hand coding the path, it works fine. But even though the path seems correct in the shell script, I get the following error from screencapture:
<Error>: CGImageDestinationCreate destination parameter is nil\n
screencapture: cannot write file to intended destination, ~/Desktop/testCap2.jpg
here's the shell script. I'm sure this is something obvious, but I'm looking at this through noob glasses! 😉 Any help would be greatly appreciated!
TIA, Vince
G5 Quad, 10.5.2
-----------
shell script below
-----------
#!/bin/sh
myPath="~/Desktop/"
fileName="screencapture"
mycount=`cat ~/Desktop/testCount.txt`
mycount=`expr $mycount + 1`
echo $mycount > ~/Desktop/testCount.txt
fileExt=".jpg"
filePath="$myPath$fileName$mycount$fileExt"
screencapture -mx -tjpeg $filePath
<Error>: CGImageDestinationCreate destination parameter is nil\n
screencapture: cannot write file to intended destination, ~/Desktop/testCap2.jpg
here's the shell script. I'm sure this is something obvious, but I'm looking at this through noob glasses! 😉 Any help would be greatly appreciated!
TIA, Vince
G5 Quad, 10.5.2
-----------
shell script below
-----------
#!/bin/sh
myPath="~/Desktop/"
fileName="screencapture"
mycount=`cat ~/Desktop/testCount.txt`
mycount=`expr $mycount + 1`
echo $mycount > ~/Desktop/testCount.txt
fileExt=".jpg"
filePath="$myPath$fileName$mycount$fileExt"
screencapture -mx -tjpeg $filePath
G5 Quad, Mac OS X (10.5.2)