From: Dave H. <gr...@gr...> - 2005-05-25 18:20:03
|
On May 25, 2005, at 3:29 AM, Jonathan Paisley wrote: > You say 'some of the files required to boot the system' - these aren't > just files required to boot the system: the system *depends* on lots > of BSD stuff in the standard unix directories, both when booting and > during normal use. I know. How painfully I know. Sigh. > I realise you may not care, but... the reason the AppleScript doesn't > work but using osascript does is due to the way the PATH environment > variable works. The PATH is inherited from the process that starts a > given program. So, in the AppleScript example, the PATH comes via > Script Editor (for example), which is eventually rooted in the > LoginWindow process. Compare this with running from a terminal, where > the PATH has been updated by whatever commands you needed to add to > make this happen. The 'osascript' command sees this updated PATH, and > therefore knows where to find the appropriate ruby. I know why it does that. The nastiness is that it makes debugging vastly worse, when what happens on "my" command line is often but not always the same as what happens at AppleScript's command line. Oh, well. (And finding the 'whereis' command frequently refusing to answer the question doesn't help. Grr.) > I'm sorry to say that this boils down again to the difference between > the Mac and Unix ways of doing things. Ruby is not yet ready for the > Mac way. Note that I agreed with this! I am, however, quite comforted that you seem to agree, generally, with the observation that it isn't the Mac way, even if it is a bit soon to expect it to be so. :) |