reading custom made number-valued attributes

Tags ( )

Mori allows its users to create custom made columns (attributes), which is really really an awesome feature.
Unfortunately, though, when I try to read values of a number-type attribute using applescript, somehow during the communication between Mori and applescript, a conversion kicks in, and the values are rounded to integers.

For example, when I add a new column called "Hours" with its type, say, NSDoubleAttributeType, and make an entry with its Hours value 3.5,
the following script:

tell application "Mori"
tell current entry
set duration to get attribute name "Hours"
return duration
end tell
end tell

it would return 3, instead of 3.5

I've tried other Column types, e.g. NSDecimalAttribute, but none of them would work properly.

There is actually a way to get around this problem, by using String type, instead of numbers, and then convert the value into real type, but in this case, Mori complains with error messages saying I shouldn't put numbers in the columns defined for String-type.

I think this is definitely a bug, and I was going to post this in the product forum so that it could be fixed in the next patch, but maybe people in Applescript forum can help me solve this problem?

Umm.. I tried String-type

Umm..
I tried String-type approach again with a new notebook, and it seems to work without constantly generating errors this time. So I guess the problem is solved...

But still, it would be nice if we can read non-integer typed values using applescript, without this string trick. Mori would not generate summaries with its total/maximal/etc. options in this way.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.