Question: DocumentTools Retrieve function returns the message "unable to retrieve label reference"


I'm trying to use the command: DocumentTools[Retrieve](path,label), but i recieve the message "unable to retrieve label reference" no mather what i do. When i use the GUI: Insert - reference and get the value it works fine, but in that way I can't assign the value to a variable in the document.

here is an example:

The document i want to retrieve a value from:


a := 5;

#a gets the label (1)


The document i want to retrieve the value to:


path := FileTools:-JoinPath([""], base = worksheetdir); = "C:\Users\Nicolai\CloudStation\Nicolai\Skole stof\Sem 7\"


Retrieve(path, "());
Retrieve(path, "(1)");
Retrieve(path, "a");

#None of the above works


Is it even possible to do such thing?

with best regards


Please Wait...