tell application id "DNtp"
set theRecord to selected record 1
set mainClass to classify record theRecord
set mainClass to item 1 of mainClass
set mainDB to id of database of mainClass
set mainPar to id of parent of mainClass
end tell
The replies are:
get selected record 1
--> content id 261422 of database id 1
classify record content id 261422 of database id 1
--> {parent id 25765 of database id 2, [...]
get id of database of parent id 25765 of database id 2
--> 2
get id of parent of parent id 25765 of database id 2
--> {2.147483645E+9}
Can somebody please explain why the id of parent of parent id 25765 is 2.147483645E+9 rather than 25765? And/or how to extract 25765 from mainClass?
Ah, missed that. It looks like what is returned for root:
tell application id "DNtp"
set theDatabase to current database
set theDatabase_ID to id of theDatabase
--> 2
set theDatabase_Root to root of theDatabase
--> parent id 2.147483645E+9 of database id 2
end tell
Um, ok, thx That is the answer to the question “why” - sort of (because I’m not sure I understand why that is the id of root). And, um, how do I make it say 25765? I mean, I could use offset, but I was kind of hoping to extract it directly.
tell application id "DNtp"
set theRecord to selected record 1
--> content id 1801922 of database id 1
set mainClass to classify record theRecord
--> {parent id 1828925 of database id 1, parent id 275106 of database id 1, […]}
set mainClass to item 1 of mainClass
--> parent id 1828925 of database id 1
set mainClass_ID to id of mainClass
--> 1828925
end tell