No longer store one variable to the clipboard but store a record.
Extracting a record from the clipboard requires an awful piece of code but it may be done.
set alpha to {property1:"4", property2:"oops", property3:"what"}
set the clipboard to alpha
delay 0.2
set maybe to list of (the clipboard)
--> {list:{"property1", "4", "property2", "oops", "property3", "what"}}
# Create a fake record
set alpha2 to {property1:"", property2:"", property3:""}
# Fill it
repeat with i from 1 to ((count maybe) - 1) by 2
if item i of maybe is "property1" then
set property1 of alpha2 to item (i + 1) of maybe
else if item i of maybe is "property2" then
set property2 of alpha2 to item (i + 1) of maybe
else if item i of maybe is "property3" then
set property3 of alpha2 to item (i + 1) of maybe
else
--
end if
end repeat
# Here we have rebuilt the original record
# We may insert code to change one of several properties before pushing it again to the clipboard
set property2 of alpha2 to "bingo"
alpha2 --> {property1:"4", property2:"bingo", property3:"what"}
set property3 of alpha2 to "WHAT"
alpha2 --> {property1:"4", property2:"bingo", property3:"WHAT"}
set the clipboard to alpha2
# Now check if the job is well done
the clipboard
--> {list:{"property1", "4", "property2", "bingo", "property3", "WHAT"}}
Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) vendredi 14 juillet 2017 10:54:58