Page 1 of 1

launch url "file:/..." with a var [Solved]

Posted: Fri Jun 12, 2015 2:56 pm
by atout66
Hi to all,

Could you tell me how to use the <launch url> command with a var inside ?
I didn't find any example in the dictionnary...
The script below does nothing because I use a global var <gLePathFolder> to give the main path.

Code: Select all

global gLePathFolder -- this path folder is correct for sure, and the file <Aide.pdf> is in there !
on mouseUp
     launch url "file:/gLePathFolder/Aide.pdf"
end mouseUp
I also tried with some <&> before and after like that:

Code: Select all

launch url "file:/&gLePathFolder&/Aide.pdf"
without success.

Thanks in advance for your help,
Regards, Jean-Paul.

Re: launch url "file:/..." with a var

Posted: Fri Jun 12, 2015 3:12 pm
by Tlaloc
Try

launch url ("file:" & gLePathFolder)

or

launch url ("file:" & gLePathFolder & "/yourFile.pdf")

in case your pdf is not already within your global var

Re: launch url "file:/..." with a var

Posted: Fri Jun 12, 2015 3:33 pm
by atout66
Hey, you've got it :D

I did this from your second example:

Code: Select all

launch url ("file:/"&gLePathFolder&"/Aide.pdf")
and it's OK.

Thanks for your help Tlaloc

Re: launch url "file:/..." with a var [Solved]

Posted: Fri Jun 12, 2015 5:25 pm
by Tlaloc
Glad you did it! :D