Jump to content











Photo
- - - - -

Newbie needs script help...


  • Please log in to reply
7 replies to this topic

#1 timaddamz

timaddamz

    Newbie

  • Members
  • 18 posts
  •  
    United Kingdom

Posted 09 February 2008 - 02:02 PM

Hi I am creating a script with the following

[codebox]If,%pCheckBox4,Equal,True,Run,%ScriptFile%,DD10 If,%pCheckBox5,Equal,True,Run,%ScriptFile%,DD10files_copy If,%pCheckBox5,Equal,False,Run,%ScriptFile%,FileCopy[/codebox] The script will not run e.g. DD10 etc. If I run the DD10 script on its own it runs fine, but when I get if to run in the If statement it will not run any ideas?

Thanks

#2 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 09 February 2008 - 03:35 PM

...
If I run the DD10 script on its own it runs fine, but when I get if to run in the If statement it will not run any ideas?

That's because, as written, your Run command is looking for a [DD10] section within that same calling script (%ScriptFile%). Based on your comment, I think you actually want to run something external to the calling script, in which case the Run command syntax must identify the specific scriptfile path, name and section. See this online doc.

If, for example, you want to run a section named [CopyFiles] in an external scriptfile named DD10.script that is located in the same folder as the calling script, the command would be: Run,"%ScriptDir%\DD10.script",CopyFiles

#3 timaddamz

timaddamz

    Newbie

  • Members
  • 18 posts
  •  
    United Kingdom

Posted 10 February 2008 - 12:13 AM

Thanks for your quick reply.

These are sections in the same script. I have written them as the help file suggests.

[codebox]If,%pCheckBox4,Equal,True,Run,%ScriptFile%,DD10 If,%pCheckBox5,Equal,True,Run,%ScriptFile%,DD10files_copy If,%pCheckBox5,Equal,False,Run,%ScriptFile%,FileCopy [DD10] contents of the section...[/codebox] If i run the sections on their own they work. e.g I take them out of the [DD10] section and put them in the main [Process] they work.

Any ideas. Would you like me to PM the full script.

#4 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 10 February 2008 - 12:42 AM

Thanks for your quick reply.

These are sections in the same script. I have written them as the help file suggests.

<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>If,%pCheckBox4,Equal,True,Run,%ScriptFile%,DD10
If,%pCheckBox5,Equal,True,Run,%ScriptFile%,DD10files_copy
If,%pCheckBox5,Equal,False,Run,%ScriptFile%,FileCopy

[DD10]

contents of the section...</div>

If i run the sections on their own they work. e.g I take them out of the [DD10] section and put them in the main [Process] they work.

Any ideas. Would you like me to PM the full script.

Sorry i don't understand your problem
The code is good
post your script

#5 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 10 February 2008 - 03:03 AM

These are sections in the same script. I have written them as the help file suggests.

Oh! Sorry. I was misled by your earlier comment about them running okay individually as separate scripts.

If i run the sections on their own they work. e.g I take them out of the [DD10] section and put them in the main [Process] they work. Any ideas. Would you like me to PM the full script.

There is no explanation that is obvious from what you've posted. So I guess we'd need the whole thing to try to help. Either PMed or attached is fine as far as I'm concerned, but the latter might get you more and better help than my tired old brain can provide. :thumbsup:

#6 timaddamz

timaddamz

    Newbie

  • Members
  • 18 posts
  •  
    United Kingdom

Posted 10 February 2008 - 12:02 PM

ok well heres my script.

I know there are other scripts for this program on the forum. I am just writing one of my own to learn how to do it.

I will add the rest of the reg entries when I get over this problem.

The idea behind my script is to be able to collect the source files and keys etc from a PC with the program installed and then build the CD on another computer that does not have the program installed.

Attached Files



#7 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 10 February 2008 - 05:23 PM

Couple of problems that I see.

1) In the [Variables] section, %ProgramFolder%=pFileBox1 should be %ProgramFolder%=%pFileBox1%. In fact you don't really need that if you simply use %pFileBox1% instead of %ProgramFolder% in the body of the script.

2) In the [Process] section, there are unbalanced percent signs. %pCheckBox1 should be %pCheckBox1% and %pCheckBox2 should be %pCheckBox2%.

Don't know how we missed that second one in your original post. Unbalanced tags seems to become something like a programming blindness after one spends a certain amount of time staring at it. Anyhow, correcting those two items should have you back on your way again.
:thumbsup:

#8 timaddamz

timaddamz

    Newbie

  • Members
  • 18 posts
  •  
    United Kingdom

Posted 10 February 2008 - 10:07 PM

Doh, thanks arvy.

i am gonna give it a go.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users