Using OSAX in ApplescriptObj'c

Can I use in an ApplescriptObj’c Xcode project PhidgetsOSA that I use in applescript to manage Phidgets ?
And if yes how can I do it ?

I’ve put in my code to try

tell application “PhidgetsOSA”
activate
end tell

but build fails with this message

AppDelegate.applescript:2: error: Expected end of line, etc. but found unknown token. (-2741)
Command /usr/bin/osacompile failed with exit code 1
?

I can’t find anything on this topic.
Thanks for helping me finding out how this can be done if it can…

Did you try it in AppleScript Editor? If it works then it probably has to do with syntax. And the OSAX extension probably needs to be up-to-date with Lion too, it’s a possibility…

Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)

What is the name of your app? Has it compiled at all before you added the tell block? I can’t tell from that error message, but it looks like there’s a colon in your name.

Ric

M’y app is called Vicdata ( I truncated the error line that’s why it doesn’t show).
Thé app without the tell block does compile. And I don’t have any colon or semi-colon in the lines.
I did check this before posting.

Thanks for taking interest in this

No problem. But you didn’t reply to one of my questions. Does it work in AppleScript Editor?

And are you certain that everything is up-to-date for Lion? There might be some incompatibilities due to OS versions. There was one wit the Adobe’s OSAX dic under Snow Leopard, needed to be upgraded for 64-bit compatibility or gave a ton of error in the console. It has been updated with Lion it seems. But your OSAX extension really needs to be compatible, especially if it hasn’t been in a while… I have looked at the company’s website and they have sample Xcode projects for version 2.4 of Xcode… things have changed a bit since!

But I could be wrong, it may have nothing to do with compatibility with Lion. It just looks like the usual suspect right now to me…

Apart from this, your syntax is pretty standard, and seems correct.

Did you use this OSAX before with success? If yes, under which environment/OS/editor?

Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)

Sorry for delays, but I’m in France and normally asleep…
Yes it works in AppleScript editor, and the Osax’s fairly recent, but don’t know when it was first written. When using their Xcode examples I did notice that they had to be ‘updated’ for my Xcode and Lion, but they worked, and these have been around much longer to what I know.
I haven’t tested it in another situation.
I think I’ll try later on today with another Osax, just to check my syntax . Any you can suggest that you know is OK?

I added this to a script, and it worked fine. I got the logs and PhidgetOSA activated:

tell application "PhidgetsOSA"
			activate
			set theVersion to version as text
			set theName to name as text
		end tell
		log theName
		log theVersion

I’m using Xcode 3 under Lion, I don’t know if that’s the difference.

Ric

Where did you get the latest OSAX? I’d like to try it under Xcode 4.1 and Lion, just to see if it’s a version problem… could be, won’t know until it has been tried. :slight_smile:

Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)

I got it from <www.phidgets.com/> under drivers

Ric

Ok, I’ll give it a try early in the morning, right now doing a full time machine backup… Will post results when I have any.

Browser: Safari 6533.18.5
Operating System: Mac OS X (10.7)

Hello, I’ve seen your problem with the App Store and won’t bother you.

But I just found out (trying to do other things) that without any lines referring to my osax my build fails now, so I think the issues were just synched somehow and this is most likely not an issue with the osax itself…
Thanks again and good luck with your submitting problem

Sorry! I did forget about this… just did a test on Xcode 4.1 and Lion 10.7.2, with rdelmar’s script in post #7, and all works fine.

Thus the conclusion is that such plug-ins still works even under a recent OS and Xcode. Therefore there is probably something wrong with the Phidget plug-ins. I’d suggest removing them and reinstalling the plug-ins from the installer available on their website… Other than that, I don’t have ideas. Sorry!

Good luck!

Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)

Thanks, as I told you I’ve now checked that a another error did actually creep in, and I mistook it for the OSAX being the guilty.
The Phidget’s osax works in 10.7 and XCODE 4.1.
Sorry for all the trouble but I’m a real newbee with ApplescriptObj’c and I want to use it to write an app to manage my remote Phidgets that control a few things at a country house.

All the luck, and if your app in the Appstore fills some of my needs I’ll look into buying it…:wink: