Shelllaunch in RolloutCreator

Hopefully somebody can help me. I've built a menu with a "rolloutCreator". This works very well.

Now I'm trying to add a helpbutton for opening a pdf-file, but it doesn't work. The code looks like this:

...
helpName = fileArray[i]
rci.addHandler (execute ("#myHelpButton" + i as string)) #pressed codeStr:("ShellLaunch helpName @/open@") filter:on
...

For testing I tried this and it worked very well:

...
rci.addHandler (execute ("#myHelpButton" + i as string)) #pressed codeStr:("print @### Test ###@") filter:on
...

What I'm doing wrong? Thank you for your help.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
DaDiceman's picture

Thank you very much! It

Thank you very much! It works!

I didn't mind the "\\". >:-)

real08121985's picture

Played around a bit and this

Played around a bit and this is the result :) hope it helps:

-- 3 ways to declare a path: 1 = absolute -> works, 2 = relative -> doesn't work, 3 = symbolic -> works
thisFolder = getFilenamePath( getSourceFilename() )
fileArray = #("C:/test/test.pdf", "test.pdf", thisFolder+"\\test.pdf")
file = fileArray[3]
 
-- if you've choosen the symbolic path, set "\" to "/", otherwise it won't work
for s=1 to file.count where file[s] == "\\" do file[s] = "/"
 
-- build rollout
rfTest = rolloutCreator "rfTestN" "rfTestC"
rfTest.begin()
rfTest.addControl #button #myButton "My Button"
rfTest.addHandler #myButton #pressed codeStr:("shelllaunch @"+file+"@ @ @") filter:on 
rfTest.end()
createDialog rfTest.def

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.