Applescript Offset Function

Hello,
I am unable to use offset function to get position of certain string in another string.

Code I am using is

set appS to "Apple"
set o to offset of "A" in appS

The error I got is

Syntax Error
Cant get "A" in appS.Access Denied.

I am using OS X 10 5

Works fine for me. Something else going on. What system are you using?

Works here too… on 10.4.11.

Just a hunch… try quitting Script Editor and reopening it.

Peter B.


Also works here on 10.6.6

Works in 10.5.8 / MacIntel.

10.5.5-8 and 1.6.7-8 all works fine here too. but I think it’s more important which applescript and standard addition you’re using.

Which version of applescript do you use and which version of the standard addition? Also are all user able to read the file? Not sure if the access denied did come from the file system but anyway the scripting addition should be readable for ‘everyone’.

And is the code within a ‘tell’ block?