SIDUG Posted April 4, 2015 Share Posted April 4, 2015 Good morning to all: I have a custom tool script that execute text command. Unlike my other scripts, after execution it doesn't return to the previous class 'None'. i.e. it will stay in ''A Note' class. That creates a bit of problem since some of the objects I create after that would be in a class which I don't want. I know I can try to remember to manually switch back to 'None' but why is it not acting like my other scripts? Much appreciation for a solution. Procedure CustTool; VAR Name:STRING; Result:BOOLEAN; BEGIN PushAttrs; FillFore(32); FillBack(0); FillPat(1); PenFore(257); PenBack(0); PenPat(2); TextFont(50); TextSize(9); TextFace([]); TextSpace(2); TextJust(1); NameClass('A NOTE'); SetTool(-200); PopAttrs; END; Run(CustTool); best regards Sidug Quote Link to comment
LarryO Posted April 12, 2015 Share Posted April 12, 2015 (edited) Could it be that the call to the text tool doesn't return you to the plugin script after the task appears finished? resulting in the PopAttrs; not being executed. I think you need to use CallTool(); instead of SetTool(); You could test this in one of two ways. By sending a Message('positive progress'); to yourself after the SetTool(); statement. If it doesn't pop up and you need to use SetTool(); you'll need to approach the task in a different manner. Another way to specifically deal with the active class setting is by capturing the active class at the start and resetting it at the end of the script. VAR activeClName:STRING; BEGIN PushAttrs; activeClName:= ActiveClass; {the PIO script} PopAttrs; NameClass(activeClName); END; Larry Edited April 12, 2015 by LarryO Quote Link to comment
SIDUG Posted April 16, 2015 Author Share Posted April 16, 2015 Hi LarryO: Sorry for the late response since I've been terribly busy(including manually setting back to None class :-) I'll try that and let you know how it worked) Many thanks Sidug Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.