Hi,
OK, the macro recording clearly does not work for that. (There is some stuff that it doesn’t work for.)
Here’s a way to do what you want. Here are two routines which you must place above and outside your macro button:
//routine to turn Folder on/off using name
[RoutineDef,ToggleFolder,
//loop until a folder is found
[Loop,[SubToolGetCount],
[VarSet,folderIndex,[SubToolGetFolderIndex,[Val,n]]]
[VarSet,st,[SubToolGetStatus,[Val,n]]]
[If,folderIndex > -1, //if we have a folder
//check the folder name is the one we want
[VarSet,folderName,[SubToolGetFolderName,[Val,n]]]
[If,(([StrLength,name]==[StrLength,folderName])&&([StrFind,name,folderName]==0)),
//if it's the folder we want
[If,turnOn,
[If,([Val,st]&0x00 == 0x00),
[SubToolSetStatus,[Val,n],0x03]
]
,//else turn off
[If,([Val,st]&0x01 == 0x01),
[SubToolSetStatus,[Val,n],0x00]
]
]
//all done, exit loop
[LoopExit]
]//end if same name
]//end if folder
,n]//end loop
,name,turnOn]
//routine to turn SubTool on/off using name
[RoutineDef,ToggleSubTool,
[VarSet,activeST,[SubToolGetActiveIndex]]
[VarSet,SubToolName,[StrMerge,"Tool:SubTool:",name]]
[IFreeze,
[If,[IExists,SubToolName],//if subtool exists
[IClick,SubToolName]//select it
[VarSet,id,[SubToolGetActiveIndex]]
[VarSet,st,[SubToolGetStatus]]
[If,turnOn,
[If,([Val,st]&0x00 == 0x00),//if off
[IClick,SubToolName]//turn on
]
,//else turn off
[If,([Val,st]&0x01 == 0x01),
[IClick,SubToolName]
]
]
]
[SubToolSelect,activeST]
]
,name,turnOn]
They are for turning a folder or a subtool off or on. You just call them using the name of the folder or subtool and then a 1 for turning ON or a 0 for turning OFF. So, for example:
[RoutineCall,ToggleFolder,"test",1]
will turn the folder called “test” ON. To turn off, you would use:
[RoutineCall,ToggleFolder,"test",0]
The same for Subtools:
[RoutineCall,ToggleSubTool,"body9_3",1]
would turn ON the SubTool named “body9_3”.
Make sure you use quotation marks around the names, as I have done.
For exporting the Document as a JPG, there is no way to get rid of having to pressing OK. But if you use a different file format then it will be automatic.
I hope this helps,
Marcus