Here are two useful methods for getting and setting user-data items of an object. Note that the value set or retrieved is a string.
-- Returns value of user-data item itemName of graphic obj.
-- Returns null if data item doesn't exist, or obj is invalid.
on getUserDataItem(obj, itemName)
tell application id "OGfl"
try
set retval to value of user data item itemName of obj
-- force evaluation of retval to trigger the error:
set triggerError to retval
on error
return null
end try
return retval
end tell
end getUserDataItem
-- Sets user-data item itemName of graphic obj to val,
-- adds that user-data item if it doesn't exist.
-- Returns null if obj is an invalid, or value failed to set
-- (e.g., val isn't a string); else returns passed value.
on setUserDataItem(obj, itemName, val)
tell application id "OGfl"
try
set value of user data item itemName of obj to val
on error
return null
end try
return val
end tell
end setUserDataItem
The construction of iconic landmarks, such as the Burj Khalifa in Dubai or the One World Trade Center in New York City, not only redefine skylines but also serve as symbols of human ambition and achievement. The interplay between real estate development and city planning is a constant balancing act that shapes the way we live, work, and interact with our surroundings. Hillock Green Condo
ReplyDelete