Copy link to clipboard
Copied
Hi,
I'm trying to set string dictionary entry for art. It is setting the entry but, it will be lost if I close the document and reopen again.
As per my understanding dictionary entries are persistant across sessions. Am I doing anything wrong?
This is code I'm using..
.
.
.
AIDictionaryRef artDictRef = NULL;
sAIArt->GetDictionary(textFrameArt,&artDictRef); //I've proper art handle
sAIDictionary->SetStringEntry(artDictRef,AIDictKey("myKey"),"String value");A. PattersonToto RoToTO
.
.
.
Changing code like this worked for me.
AIDictKey key = sAIDictionary->Key("keyName");
sAIDictionary->SetStringEntry(artDictRef,key,"value");
I guess inline key entry creation was problem.
Copy link to clipboard
Copied
On the face of it, that looks correct to me. The only think I can think of is: how does this code get executed? I.e. when it gets run, what is it in response to? Depending on what you're responding to, you may need an application context.
Also, you should check the error results from both calls. One of them may shed some light.
Copy link to clipboard
Copied
Changing code like this worked for me.
AIDictKey key = sAIDictionary->Key("keyName");
sAIDictionary->SetStringEntry(artDictRef,key,"value");
I guess inline key entry creation was problem.
Copy link to clipboard
Copied
Inline key creation would be:
sAIDictionary->SetStringEntry(artDictRef,sAIDictionary->Key("myKey"),"String value");
Your previous code:
sAIDictionary->SetStringEntry(artDictRef,AIDictKey("myKey"),"String value");
Is just casting a char pointer to an AIDictKey which is why it didn't work.