The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Where to define personal variables? Thread Tools Search this Thread Display Modes
Hi everybody,

one question:

I would like to create a new variable - like:

<%myvariable="hello world"%>

where can I find the field to define the the variable etc.?

Regards Hans
 
In OmniGraffle Professional, you can use the custom data key value pairs to create custom variables. So, if you have a custom data key "foo" whose value is "bar", then putting in the variable "<%UserData foo%>" will result in "bar" appearing in that part of the text.

Hope that helps,
__________________
"Vroom! Vroom!!"
 
Quote:
Originally Posted by Joel View Post
In OmniGraffle Professional, you can use the custom data key value pairs to create custom variables. So, if you have a custom data key "foo" whose value is "bar", then putting in the variable "<%UserData foo%>" will result in "bar" appearing in that part of the text.

Hope that helps,
Thank you for your answer. But my problem is: where is the place / the field to define this variable?

I understand:

1) there is a field to define a variable, but I don't now the field.
2) inside the "work space" I insert a Textfield with this variable, for example <%foo%>.

If I understand something wrong, than sorry for that.
 
You define the variable in the Notes & Data Inspector (this is only in OmniGraffle Professional, so if you're running the standard version of OmniGraffle it's not present).

The Notes Inspector is part of the Properties inspector group.
__________________
"Vroom! Vroom!!"
 
Quote:
Originally Posted by Joel View Post
You define the variable in the Notes & Data Inspector (this is only in OmniGraffle Professional, so if you're running the standard version of OmniGraffle it's not present).

The Notes Inspector is part of the Properties inspector group.
At first, I have the Professional Version.

Ok, thank you for your description. I have tested your tip - see screenshot. I am sure, there is something wrong, what I have done. It doesn't work.

I am feeling sorry to ask you again.

 
You need to put UserData in front of foo:

<%UserData foo%>
 
Quote:
Originally Posted by hansemannk View Post
Thank you for your answer. But my problem is: where is the place / the field to define this variable?

I understand:

1) there is a field to define a variable, but I don't now the field.
2) inside the "work space" I insert a Textfield with this variable, for example <%foo%>.

If I understand something wrong, than sorry for that.
This seems to only work on an instance by instance basis. Is it possible to create a global key/value relationship for the entire document that affects text boxes across multiple instances/pages at once?

Thanks!
 
There doesn't seem to be an easy way to set global variables, but there are a couple of workarounds.

1. As Uetzicle noted, there are a number of document variables in the Document:Data inspector. (There are ten, some in a pulldown.) If you're not using them already you can put whatever you want in those fields and access them anywhere using the <%Variablename%> syntax. Of course, you can't rename them, which is inconvenient.

2. Use a script:
Make a new layer in a convenient canvas and create a shape or piece of text. Set the shape's Properties:Action to "Runs a Script" and enter the following script:
repeat with theGraphic in every graphic of every layer of every canvas of the front document

if theGraphic is not self

set the value of user data item "myGlobal" of theGraphic to the text of self

end if
end repeat
Use <%Userdata myGlobal%> for your variable wherever you want. Hide and mark unprintable the layer with the variable-setting shape, only showing it when you want to set the variable: change its text and click with the Action Browse tool. (Surprisingly, I found that after the first action click the user data on all the objects actually changed whenever the text of this shape changed; no need for the tool.)

For more variables, you could make more shapes in the hidden layer, or perhaps more elegantly, replace the "set" line in the script with:
set the value of user data item "myGlobal" of theGraphic to the value of user data item "myGlobal" of self
Add similar lines for as many variables as you need, with a data key and value for each one in Properties:Note of the variable-setting shape. Change values there and use the Action Browse tool to set the variables. You could even label the shape "myGlobal = <%Userdata myGlobal%>, otherGlobal = <%Userdata otherGlobal%>" and so on. In that case you could keep the shape visible and use it as an annotation in the document.

(Thanks to member apl for the right syntax for referring to user data item values: http://forums.omnigroup.com/showthread.php?t=18144 .)

Last edited by john.gersh; 2011-06-15 at 08:50 AM..
 
Great discussion. This solved my problem. NOW, it would be nice if there was an document object model (DOM) behind the scenes so that we could do something like "Document.version" to get the current document's version number and the like. This would be SO very useful to all us power users out here.
 
Yes! great! Now I can do things here I was doing in Vectorworks!
One other question, and I think this is what cwingrav was asking about, how can I have a global value so I can have info on all the canvas's from one area? Like I currently use page name, creation date, etc.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Define constraint as a function of another task? juliabell OmniPlan General 1 2009-09-12 10:30 PM
Define group to be 100% complete juliabell OmniPlan General 1 2009-09-12 07:03 PM
How to define non-tree relationship? Schlaefer OmniGraffle General 1 2008-09-10 10:58 AM
Define with OmniDict beelers OmniWeb Feature Requests 0 2008-03-15 08:20 AM


All times are GMT -8. The time now is 03:44 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2023, vBulletin Solutions, Inc.