Just a quick question, because I am totally new to all of this.
EDIT: I have edited this post because I was able to find some new information.
However, I am not able to get the toolbar to show when Arbortext is first started
and I think it's because there's no window yet and so my init() function is being
called too early. I don't know how to fix that.
I still cannot figure out where to put this ACL code so it will run correctly and at the right time. As you can see, I have created an ACL file, called "my-custom-toolbar.acl", and it has the following code within it:
# My ACL file "my-custom-toolbar.acl"
# Set _debug variable so I can see the response output
global _debug = 1
function init(win = current_window())
{
if (window_state(win) < 0) {
if(_debug) {
# The $win variable is always -1 because when Arbortext \
# is first started, there's no window yet!
response("Invalid window $win")
}
return
}
local doc = window_doc(win)
if (!doc_valid(doc)) {
if(_debug) {
response("Invalid document")
}
return
}
return win
}
# Call the above function
init()
I put it in the C:\Program Files (x86)\PTC\Arbortext Editor\custom\init folder because I want it to run as soon as the Arbortext editor has finished starting up. When it runs it fails because the $win variable is -1. I am guessing that it is -1 because the Arbortext window is not yet loaded when the above script runs. In other words, the script runs too early. This is where I remain stuck. How do I check to see if the Arbortext editor has fully started before trying to load my custom toolbar in it?