Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro usage in Service Center 2

Status
Not open for further replies.

srambo

Technical User
Nov 25, 2003
3
0
0
US
Has anyone used a macro facility is service center called scmacro.exe that is in the RUN directory. It basically records steps one does in service center and handles the various clicks you do. I have come across uasage like TRANSACT, STEFOCUS, GETVALUE, system parameters like SYSFORMNAME, SYSPARM0 etc.

Anyone has experience in using those functions? Any documentation have you come across?

Thanks
 
Hi,

I have played around with it a bit but have not come across any documentation for it.

Actually some months back the answer from Peregrine was that the macro recorder function is not an offically supported product and does not have documentation as such.

On the other hand, Peregrine does currently have an SCR open because of a request for documentation for this product (SCR number: 24866). I recommend that you refer to this SCR if you plan to request information about the product from Peregrine.

Below URL also mentions the product:

cheers
 
If you could post some of the different macro's you have used whcih uses different commands, it will help me in understanding a bit more. I am puzzled by the usage of TRANSACT which takes an integer paramater like 0, 20, -26 etc ... I am not sure to its consitent usage ... I am sure it must be something like a commit/execute ...

Also, since I do not have access to the URL you have mentioned, is there a way to post it otherwise

Thanks
 
sorry, I forgot that you would have to register with before you can access the page.

(sc-resources.net is a site dedicated for Peregrine products, albeit not otherwise affiliated with PRGN)

I probably better point out as well that there is not that much technical information about the Macro recorder at that site. As far as I know, the only location where such info could be obtained from is Peregrines development team...and as it is now, they are not speaking.

Another issue is that I have just played around with it...and this was some time ago...so I do not have any scripts available at the moment. But I can look into this, no problems (it's kind of interesting anyway).
 
just noticed something...

as to the transact values, I do not know if this is what you referred to but here it is anyway:

If I create a short macro that adds a company record, the steps in the .vbs file look like:

<snip>
' Begin transaction number 1 at form 'menu.gui.home'
sc.Transact(35)
' end Transaction
r = sc.SetFocus( &quot;customer.id&quot; )
'
' Begin transaction number 2 at form 'company.g'
sc.Transact(6)
' end Transaction
'
' Begin transaction number 3 at form 'company.qbe.g'
r = sc.SetValue( &quot;SYSPARAM0&quot;, &quot;4&quot; )
sc.Transact(0)
' end Transaction
r = sc.SetFocus( &quot;company.full.name&quot; )
'
' Begin transaction number 4 at form 'company.g'
r = sc.SetValue( &quot;customer.id&quot;, &quot;00005&quot; )
r = sc.SetValue( &quot;company&quot;, &quot;ACPE&quot; )
r = sc.SetValue( &quot;company.full.name&quot;, &quot;ACPE, INC.&quot; )
sc.Transact(1)
' end Transaction
r = sc.SetFocus( &quot;customer.id&quot; )
</snip>

I noticed that the values that are specified in the parenthesis directly following the term &quot;sc.Transact&quot; correspond to the button ID values (or option values) for the button to be executed. For example, under &quot;transaction number 1&quot; we have the command &quot;sc.Transact(35)&quot;. The number 35 here corresponds to the &quot;Option #&quot; specified for the &quot;Companies&quot; button on the &quot;menu.gui.home&quot; form.

The numbers shown in subsequent transactions correspond to the GUI Option number in the Display Screen at that point.

cheers,
 
another thing I noticed is that the macro created by the macro editor can also be used from Excel. This can be seen as follows:
1. record a macro .vbs file
2. open the .vbs file in e.g. notepad
3. copy the entire text to clipboard
4. open Excel (this example uses v.2002)
5. click on Tools > Macro > Macros
6. give the macro a name and click on &quot;Edit&quot;
(Microsoft Visual Basic window opens)
7. paste the clipboard contents into the Module window
8. close the Visual Basic window
9. click on Tools > Macro > Macros
10. select the your new macro and click on &quot;Run&quot;

I have only tested this on one macro but it looks as if the vbs code created by scmacro.exe is compatible with Excel's code.

hope this helps
 
FYI: scmacro.exe is likely not going to be included in future versions of ServiceCenter.
 
FYI 2: this is an excerpt of something I had posted at another forum, but thought that it might come useful to someone reading this thread as well:

scmacro.exe can be launched by pressing CTRL+SHIFT+M while the ServiceCenter GUI window is open. It's main functionality is to record a users activities in SC onto a .vbs file for the purpose of replaying them later. This can be useful when creating scripts for e.g CTI (Computer-telephone integration).

scmacro.exe records the activities using a set of functions that are exposed by a SC activex server component called &quot;servicecenter.exe&quot; (also by default in the ../RUN folder). The list of exposed functions are as follows:

-GetValue(FieldName As String) As String
-GetValueByRef(FieldName As String, FieldValue As String) As Integer
-SetFocus(FieldName As String) As Integer
-SetValue(FieldName As String, FieldValue As String) As Integer
-StartMacro(MacroFileName As String) As Integer
-StillActive() As Integer
-StopMacro() As Integer
-SystemEvent(EventString As String, EventParms As String) As Integer
-Transact(ButtonId As String) As Integer

NOTE: In order to succesfully execute these actions against ServiceCenter, the &quot;servicecenter.exe&quot; component must have been registered in the Windows system (normally happens during installation, otherwise use the Windows &quot;regsvr32&quot; tool). Another requirement is that the ServiceCenter client must be 'up and running' on the system (which means that the actions can only be executed on the FOREGROUND).

Best regards,

Jarmo
 
I've been playing around alot with the macro's in SC, is there a way to map them to a shortcut key though, like Ctrl+1, Ctrl+2, etc. They are easy enough to create but running multiple ones is a pain without shortcuts. I realize this isn't supported but I was just wondering if someone had a solution.
 
Does anyone have any know how to use a VARIABLE in SC.MACRO.

Al I can use is SC.SETVALUE. I want to use an INPUTBOX and use the value of that box in an INCIDENT ???

Thanks
 
You could declare a string variable, pass the value of inputbox to the string variable and use in the script

eg:

dim str as string
str= userform.textbox.text
sc.SetValue("contact.name", str)

It should work !!!

 
It's been driving me nuts with that active-x error when trying to runn the scmacro.exe program. Thanks fro letting me know I have to register the servicecenter.exe file. I have been reguistering every other file but that one. Thanks a lot!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top