<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I changed the topic so many can avoid it and we don't bore them to tears ;-)<DIV><BR><DIV><DIV>On Apr 20, 2006, at 2:02, has wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">As for working with HFS paths (and a pox on scriptable apps that require them, btw, because they're fundamentally unreliable), you ought to be able to use Carbon.CF to translate between POSIX/Windows/HFS path styles. Unfortunately, I suspect getting in and out of there may be one of the areas that's broken.</FONT></P></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>I am writing an app combining excel and python/appscript to fetch quotes from the web and value stock portfolios . </DIV><DIV>But I give up on using appscript with Excel--some things just don't work because I think the terminology is seriously warped if no broken. Applescriptworks but appscript doesn't.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I instead build a text Applescript from strings and use popen2 to invoke osascript like this example which reads in the stock symbols from a named range in an excel spreadsheet:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> def readSymbolList(self, workbook, worksheet, range):</DIV><DIV> _getSymbolsScript = """tell app "Microsoft Excel"</DIV><DIV> return Value of Range "%s" of Worksheet "%s" of Workbook "%s"</DIV><DIV> end tell"""</DIV><DIV> # read symbols from spreadsheet </DIV><DIV> cout, cin = popen2.popen2( "/usr/bin/osascript -e \'%s\'" % \</DIV><DIV> (_getSymbolsScript % (range, worksheet, workbook)))</DIV><DIV> symbols = cout.readline()[:-1]</DIV><DIV> symbols = re.sub(",\s",",",symbols)</DIV><DIV> if (self.DEBUG):</DIV><DIV> print __module__, "::","symbols=", repr(symbols)</DIV><DIV> # create symbolList</DIV><DIV> symbolList = []</DIV><DIV> symbols = string.split(symbols, ",")</DIV><DIV> if (self.DEBUG):</DIV><DIV> print __module__, "::","stocks=", repr(symbols)</DIV><DIV> for symbol in symbols:</DIV><DIV> if (symbol != '0'):</DIV><DIV> symbolList.append(symbol)</DIV><DIV> cout.close()</DIV><DIV> cin.close()</DIV><DIV> return symbolList</DIV><DIV><BR><BLOCKQUOTE type="cite"> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I wouldn't mind adding a makewithhfspath class method and hfspath instance method to macfile's Alias and File classes, but I'd want to be sure I had a correct implementation first, however, as it's not quite as trivial as it sounds on the surface (e.g. volume names are not a direct translation in either direction).</FONT></P> </BLOCKQUOTE><BR></DIV><DIV>If you really desire to you can but I just wrote a quick hack using re.sub() that correctly converts the paths I use so my needs are met.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Daniel</DIV><BR></DIV></BODY></HTML>