Results 1 to 5 of 5
  1.    #1  
    Hi Guys,

    New to morts. Can I run my script like "\program files\mort\mymort.mscr -reboot"? I didn't find a way to take a parameter in the script.

    Thanks for help.
    Treo 750 unbranded T-mobile, HTC WIZARD 8125 T-MOBILE (broken), Treo 650 T-mobile 1.43/1.14 OS 5.4.8 Garnet (sold).
    Dell X50v, X30 624Mhz and HP ipaq h2210 h1945.

    Treo 750 hacks thread.
  2. #2  
    Quote Originally Posted by cellneuron View Post
    Hi Guys,

    New to morts. Can I run my script like "\program files\mort\mymort.mscr -reboot"? I didn't find a way to take a parameter in the script.

    Thanks for help.
    Yep. The syntax is a bit clumsy though.

    If you are using Run() or RunWait(), you need to:

    1) invoke MortScript.exe directly rather than the script
    2) combine the script name and the parameter into a single string
    3) pass the parameter in via a variable assignment
    4) double-quote the script or the argument IF they contain a space

    i.e.)

    RunWait("\Program Files\MortScript\MortScript.exe", """\Program Files\mort\mymort.mscr"" ARGS=-reboot")

    When mymort.mscr is run, the variable ARGS will be set to the string "-reboot"

    Wasn't that obvious?
  3. #3  
    i have something like this in one of my scripts. it waits 60 seconds and then does a softreset

    sleep (60000)
    reset


    it's really pretty simple. lol.
  4. #4  
    You can also create a shortcut that calls your script with a parameter. Edit the shortcut target like this.

    "\Program Files\MortScript \MortScript.exe" "\pathtomymort\mymort .mscr" ARGS=reboot

    Where pathtomymort is the full path to your script. ARGS is the variable that is being assigned. You can assign multiple vars also this way.

    "\Program Files\MortScript \MortScript.exe" "\pathtomymort\mymort .mscr" ARG1=reboot ARG2=30
    Last edited by hannip; 06/13/2007 at 07:44 AM. Reason: fixed typo in target
  5.    #5  
    nice, thanks all for answers. I will try it now.

    Updated: Work like a charm. Now I combined my codes in one script.
    Last edited by cellneuron; 06/13/2007 at 10:23 AM.
    Treo 750 unbranded T-mobile, HTC WIZARD 8125 T-MOBILE (broken), Treo 650 T-mobile 1.43/1.14 OS 5.4.8 Garnet (sold).
    Dell X50v, X30 624Mhz and HP ipaq h2210 h1945.

    Treo 750 hacks thread.

Posting Permissions