You are not logged in.
UPDATE: This handler value should be doubleValue() so I have correct that.
Applescript:
set theValue to my expressionWithFormat:"add:to:(10,50)"
on expressionWithFormat:theExpression
return ((current application's NSExpression's expressionWithFormat:theExpression)'s expressionValueWithObject:(missing value) context:(missing value))'s doubleValue()
end expressionWithFormat:
Last edited by Fredrik71 (2021-04-27 04:57:07 am)
if you are the expert, who will you call if its not your imagination.
Offline
To get the expression representation you should not ask for its value:
Applescript:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions
set theExpession to current application's NSExpression's expressionWithFormat:"add:to:(10,50)"
log (theExpession)
--> RESULT: "(NSFunctionExpression) 10 + 50"
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
To get the expression representation you should not ask for its value:
Its was the value I was interesting in and on my machine I got the right result in log but
not as result. That why I created this topic in the first place. The solution was to restart my computer and everything is correct.
I guess Apple Events or communication to it could hang. The strange thing was that the log worked.
It have never happen to me before.
if you are the expert, who will you call if its not your imagination.
Offline