I was looking for some tips. I have some XML data I wanted to get into filemaker pro. Right now I am using perl to retrieve the data and I wanted to get this into a FMP data base. I was thinking that applescript would be my best bet to process this. I was looking for some direction to focus my efforts.
My perl skills are very weak.
Applescript skill are much better.
The data is ebay category information so it could large. (sample below)
FMP 5.5 (could upgrade to 6 or 7 if needed)
Mac os 10.4.2
There are AppleScript tools for parsing XML, like Satimage’s, but I couldn’t manage to parse your example using them, so I suspect it is ill formed, incomplete, or unique to ebay. You’ll have to pursue the document object model ebay uses.
Unless you must, saving that as rtf just complicates things because the parser doesn’t know how to deal with the rtf formatting. It should be plain unicode text.
The link you gave is to a file on your machine rather than on ebay’s, but here’s how you get a link’s contents into an AppleScript:
set xml to do shell script "curl [url=http://homepage.mac.com/jman1/sale/ebayXMLfile.rtf]http://homepage.mac.com/jman1/sale/ebayXMLfile.rtf"[/url]
set xml to do shell script “Perl /Library/Perl/getcatsL1.1.pl”
This is the perl script I run from the Terminal to get the xml info from ebay.
I get this error message in response.
Can’t locate LWP/UserAgent.pm in @INC (@INC contains: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .) at /Library/Perl/getcatsL1.1.pl line 3.
BEGIN failed–compilation aborted at /Library/Perl/getcatsL1.1.pl line 3.
Do I have to tell applescript where LWP user agent is ??