January 18, 200818 yr Ok I would like a custom dialogue comming up with a question and depending on the button pressed run either script 1 or script 2 however there does not seem to be a way of running a script from custom dialogue : which can't be right....
January 18, 200818 yr The custom dialog would be called from within a script. Then the button choice would branch the script to the appropriate subscript using Get(LastMessageChoice).
January 18, 200818 yr The pseudo code for the script should be along the lines of Show custom dialog (with your question, and the answer to perform script 1 should be the defaullt button. Button 2 should be the naswer for script 2 to be done) If [Get{Last message choice) = 1] Perform script [1] else Perform script [2] Edited January 18, 200818 yr by Guest
January 18, 200818 yr Author somehow the show custom dialogue with the IF statement seems to break a local variable I created to create the file name and path to save the file... so the variable is not recognised :? What could be going wrong there :)
January 18, 200818 yr Hi make that variable global ( $$ ) and set it to empty at the end of your script.
January 18, 200818 yr Author Thanks when I call it do I need to call it with $$myvariable or $myvariable how do I clear it ? Thanks.......
January 18, 200818 yr Author It seems my variable for setting the file name and saving to the temp path is not working with a double script like this it does work when I just have a simple script with no IF statements etc.... I have Set Variable [$$filepath; Value: Get ( TemporaryPath ) & $fieldname & ".pdf"] which works for a simple script to print out a load of layouts at once and name the file with a pre determined name. However when I put in a dialogue box and a IF statement the filee name is not remembered and cannot be used for saving the file. You get this error... "$$filepath" could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk.
January 19, 200818 yr Author you mean..... Set Variable [$$filepath; Value: file: & Get ( TemporaryPath ) & $fieldname & ".pdf"] ?
January 19, 200818 yr Yes. Check out Help for Creating File Paths Also, the reason that you've been instructed to use a global variable is bcs it seems that you are passing $filepath to another script and local variables only exist in the script that creates them. You could also use a scriptparameter.
January 19, 200818 yr Author How come it worked OK before without this ? I mean I realise it does not work now ..... But it did and it still does in a single simple script...
January 19, 200818 yr Post the file, please. Also, now you're going from one script to another. Any local variables do not carry over to another script. Since I've never seen your original script, all I can do is guess. When is $fieldname set? Edited January 19, 200818 yr by Guest
Create an account or sign in to comment