Using open process instead of shell
Stephen Barncard
stephen at barncard.com
Sun Dec 24 17:05:21 EST 2017
Hi gang, I need a little help here.
I am creating a Macintosh app on the desktop for my own use.
I am making an archive of all the "Spirit of K JAZ" shows by the late
Jerry Dean. After the terrestrial radio station went off the air, he
and fellow air mate Stan Dunn started streaming the shows on the net for
most of the 2000 decade. There are over 800 1-hour shows in this
collection.
After archiving the first 200 shows, I quickly tired of using individual
apps to do the separate steps of photographing the cover, putting in
folder, and transferring the data, while keeping the same file name for all
of them. So I created a stack which controls several command line
executables
I have three executable binaries that I call from this app.
imagesnap
ffmpeg
SOX
All of the commands work great by using the shell command in LC, except for
the fact that my app waits until some of the commands have finished.
In the case of one of them for example, it is importing a audio file from
a CD, and turning it into a wave file using *ffmpeg*.
./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff'
'/Users/stephenbarncard/Desktop/img/20171113_LIVE_ON_MARz.wav'
[ above command on one line ]
This takes up to 10 minutes to copy for a 60 minute CD.
The ./ at the beginning is the only difference between what I was
saying in my shell call from LC and what works in Terminal.
The executables live directly adjacent to the live code stack, to simplify
addressing. I got about this far with my coding, reading stuff from
forums and the dictionary, but I just can't seem to put the right words
together.
pData is the command that works from the shell.
on executeProcess pData
put whereAmI() into a; set the defaultFolder to a
get "file:xprocess.bat"
put pData into URL it
open process "file:xprocess.bat" for text write
etc..
close executeProcess
Does someone out there have a clear example of what I am looking for,
using a UNIX executable through *open process *?
1. call the function with parameters
2. allow livecode scripts to continue
3. continuously monitor and display data returned by that function
thank you all so much for any and all information,
And a happy non-sectarian Christmas to everyone!
*Stephen Barncard - Sebastopol Ca. USA - *
*mixstream.org* <http://mixstream.org>
More information about the use-livecode
mailing list