Page 1 of 1

[Solved] Problem with my first script

Posted: Tue Aug 21, 2018 3:13 am
by gmb
Hello,
I am French and I use Google Traduc to write to you.

I have MM gold and I am looking to do my first Scrip.
I use Notepad ++ to write the VbScript.
I created a simple script.
I added the entry in Script.ini.

When I test my MM script gives me error 13 Ms VBScript Line 1 column 0 execution error.

Here is the Script:
Sub CallMe

' This script will pop up a simple message box when the procedure CallMe is called.
MsgBox "CallMe was called by the action defined in the Scripts.ini file."

End Sub

Question:
which encoding should I use with Notepad ++ to create the MM Script?

Cordially
GMB

Re: Problem with my first script

Posted: Tue Aug 21, 2018 1:53 pm
by rivorson
Try adding parentheses after the Sub name.

Code: Select all

Sub CallMe()

' This script will pop up a simple message box when the procedure CallMe is called.
MsgBox "CallMe was called by the action defined in the Scripts.ini file."

End Sub

Re: Problem with my first script

Posted: Wed Aug 22, 2018 1:53 am
by gmb
Thank you,
I tested and no change.
I do not know if this is related to Notepad ++ or anything else.
I tried to copy paste a script that works in mine and well I have the same problem.

Gmb

Re: Problem with my first script

Posted: Sat Aug 25, 2018 2:29 pm
by Peke
Please note that VBS file needs to be saved as plain ASCII Notepad++ can save UTF8 txt file and that make issues due the BOM character.

Re: Problem with my first script

Posted: Sun Aug 26, 2018 10:49 am
by gmb
Pavle thank you for your answer.
NotePad ++ offers as ANSI encoding but not ACSII.
Is it the same?
If not what program to use to write a script in ACSII?
A +

Re: Problem with my first script

Posted: Sun Aug 26, 2018 4:05 pm
by Peke
They are same :) ANSI is Character set and ASCII is Code Page.

Re: Problem with my first script

Posted: Mon Aug 27, 2018 2:31 am
by gmb
OK, thanks,
I retested by recording in ANSI.
No change.
Always the same mistake!
Good I give up!
I will not do MM Script.
Thanks for your help.
by

Re: Problem with my first script

Posted: Mon Aug 27, 2018 8:40 am
by rivorson
The problem may be in your Scripts.ini.

I have tested and got the same error if the ProcName declared in Scripts.ini does not exist in the script.

In your case, the section in Scripts.ini should contain

Code: Select all

Procname=CallMe
If it still doesn't work, post the contents of your Scripts.ini.

Re: Problem with my first script

Posted: Tue Aug 28, 2018 4:08 am
by gmb
A big thank you it works.
I can finally start to make my first script.
by.