Creating a script for a specific instance of Synergy
You can create or edit a script to call the specific instance of Synergy you are working with on your machine.
Each instance of Synergy is assigned an instance ID, which can be found in the About box. This changes every time Synergy is launched, but can be used to check against your script to ensure that the correct instance of Synergy has been called.
The first line of any script or macro, designed to call the specific instance of Synergy, must be:
'%RunPerInstance
Take a look at the API example script: The first lines of a script, to see an example of how to script for a specific instance of Synergy.
Type the line above as your first line.
Type explanatory comments to explain the code.
Type
Option Explicit
to reduce programming errors.
Type
SetLocale("en-us")
to force your system to interpret numerical values as they are in the US.
Type
Dim SynergyGetter, Synergy On Error Resume Next Set SynergyGetter = GetObject(CreateObject("WScript.Shell") .ExpandEnvironmentStrings("%SAInstance%")) On Error GoTo 0 If (Not IsEmpty(SynergyGetter)) Then Set Synergy = SynergyGetter.GetSASynergy Else Set Synergy = CreateObject("synergy.Synergy") End If
to create an OLE automation object which starts the specific instance Synergy that you are working in.
Continue with your scripting.
Type
MsgBox "Script Complete"
Type
Wscript.Quit