Re: Fink and 'sh'
Re: Fink and 'sh'
- Subject: Re: Fink and 'sh'
- From: Graff <email@hidden>
- Date: Mon, 22 Mar 2004 16:17:51 -0500
Of course, as someone already said, this solution depends on the
"where" command being able to find the "lame" command. The problem is
that the "where" command looks at your PATH, which is not set properly
in the first place. This means that it won't find "lame" so it is kind
of circular in this case. I didn't think of this when I first posted
my answer.
The new answer? Either:
1. assume that "lame" is in a certain location such as /sw/bin/lame and
do a simple check for it there before you try to run it
or
2. save the script as an application bundle and put lame inside the
bundle. Put it into /path/to/yourapp.app/Contents/Resources/ and then
use a relative path to it:
---------
set myinputfile to "/blah/blah/blahin"
setmyoutputfile to "/blah/blah/blahout"
set lamePath to (path to me as text) & "Contents:Resources:lame"
set posixPath to quoted form of POSIX path of lamePath
do shell script lamePath & " " & myinputfile & " " & myoutputfile
---------
- Ken
On Mar 22, 2004, at 10:25 AM, Graff wrote:
On Mar 22, 2004, at 7:12 AM, Walter Ian Kaye wrote:
One method for doing this totally via AppleScript would probably be to
do something like:
-------------
try
set haveLAME to do shell script "/bin/tcsh -c 'where lame"
if haveLAME is not equal to "" then
set lamePath to first paragraph of haveLAME
do shell script lamePath & " " & myinputfile & " " & myoutputfile
end if
on error
display dialog "LAME not installed. Go on the net and get it?"
open location "http://www.culater.net/osd/packages.html"
end try
-------------
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.