Is there an ability to have hyperlinks to web-based content in ChordPro? or anywhere in GP5 for that matter?
Please do not post the same question in different posts.
Thank you
You can put a link to an image that lives on a website and it will be displayed but that’s about it – our system wasn’t designed for such things. You can
E.g., put this in a chordpro document
{image: https://gigperformer.com/wp-content/uploads/2024/02/gigperformerlogo-wide-light-2.png}
On a Mac in GP Script you can write something like this
var s : String = Shell("open https://google.com")
in a call back and that will open your default web browser to the URL
Cool feature. So, the Windows equivalent:
Add a widget to your panel and set the GPScript handle to LoadPDF. Add the script below to the current rackspace.
var
LoadPDF : widget
On WidgetValueChanged(w : Widget, curindex: integer, newValue : double) from LoadPDF
var s : string
if newValue == 0 then
s = Shell("C:/Windows/explorer.exe file:///C:/<<the full path name is required>>/against%20the%20wind%20official.pdf")
end
End
Note using / instead of \. It’s a Microsoft unix compatability thing.
Note:
if newValue == 0 then
will result in the shell executing every time the song is opened.
if newValue == 1 then
will allow for only exicuting the shell when the widget is activated
I typed in: var s : String = Shell(“open https://google.com”) and the result was not bringing up my browser with Google, instead, it just typed the line: var s : String = Shell(“open https://google.com”). What did I do wrong?
Where? Did you put it in a callback or an initialization section? Are you on Mac or on Windows? Did you get a compile error?
Please be very precise — a phrase like “it just” doesn’t tell us anything, to what does “it” refer?
What just typed that line? GPScript won’t print a line unless you actually use a Print statement. Where did you see that line?
Yeah, my lack of experience, I’m afraid, I tried pasting it into the ChordPro Editor, DOI! Anyway, in the GP Script Editor it works just fine, like it’s supposed to. I’ll take it from here though I’m sure I’ll have other questions. Thanks so much!
IN WINDOWS:
What if the command you need to run includes ASCI 34, double quote?
Alternatively, what if you want to you want to launch a URL, which requires using “start” and you need to include “&” in the URL? “&” is a special character in “start” and does not get passed unless the entire URL is in double-qoutes.
start “https://my.web.com/page?param1=val1¶m2=val2”
ignore how this editor modifies ASCII 34 on each end to be begin and end double qoutes.