redballoon Posted January 18, 2008 Posted January 18, 2008 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....
Reed Posted January 18, 2008 Posted January 18, 2008 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).
efen Posted January 18, 2008 Posted January 18, 2008 (edited) 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, 2008 by Guest
redballoon Posted January 18, 2008 Author Posted January 18, 2008 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 :)
Raybaudi Posted January 18, 2008 Posted January 18, 2008 Hi make that variable global ( $$ ) and set it to empty at the end of your script.
redballoon Posted January 18, 2008 Author Posted January 18, 2008 Thanks when I call it do I need to call it with $$myvariable or $myvariable how do I clear it ? Thanks.......
Raybaudi Posted January 18, 2008 Posted January 18, 2008 1) $$myvariable 2) Set Variable [ $$myvariable; Value: ""]
redballoon Posted January 18, 2008 Author Posted January 18, 2008 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.
redballoon Posted January 19, 2008 Author Posted January 19, 2008 you mean..... Set Variable [$$filepath; Value: file: & Get ( TemporaryPath ) & $fieldname & ".pdf"] ?
bcooney Posted January 19, 2008 Posted January 19, 2008 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.
redballoon Posted January 19, 2008 Author Posted January 19, 2008 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...
bcooney Posted January 19, 2008 Posted January 19, 2008 (edited) 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, 2008 by Guest
Recommended Posts
This topic is 6154 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now