Using Macros in Passolo
Instead of using an external programming development tool, you can also use the scripting engine embedded in Passolo. The scripting engine is VBA compatible and includes an editor and a debugger.
Macros are managed in the dialog Macros (menu Tools / Macros). You can edit or run existing macros and you can create new macros. Also you can assign a shortcut to a macro so that you can execute macros in Passolo at any time by just pressing the shortcut.
When a macro will be executed the subroutine main will be called and Passolo will wait until the subroutine is finished.
An instance of the PassoloApp object is available at any time when a macro is running and can be accessed using the object variable PSL. So the previous sample code will also work in a macro. Only the declaration and creation of PassoloApp has to be deleted:
Sub Main
'Open the project
PSL.Projects.Open ("c:\ddata\demo\notepad\notepad2.lpj")
' Update stringlists
PSL.ActiveProject.SourceLists(1).Update
PSL.ActiveProject.TransLists(1).Update
' Autotranslate
PSL.ActiveProject.TransLists(1).AutoTranslate
' Generate targetfile and quit
PSL.ActiveProject.TransLists(1).GenerateTarget
End Sub