Re: Please suggest script
Tim, What you need to do is to loop your fields using a Regular Expression ( http://www.regular-expressions.info/ ) and MatchChunk to find out what chunks are URLs. Then you set the textstyle of those chunks to linktext. On the fields you intercept linkclicked and the clicked text will be the urls which you will be able to open with RevGoURL. Sorry but I can't help you with the RegEx, I am not that good with them and I don't have an URL extraction RegEx handy in here. I can try to cook something at some later time but right now it is not possible for me. Cheers andre On Wed, Nov 17, 2010 at 3:58 PM, Timothy Miller gand...@doctortimothymiller.com wrote: Sigh... Always the newbie... I have a rev stack containing tens of thousands of words of notes, in plain text, in various fields, on many cards. I won't bore you with the details. Some of these notes include URLs for web sites, in plain text. There are hundreds of these. I'd like to be able to highlight a web URL, click on a button, and turn the text into a clickable link. (We can assume my web browser is already open) Is this possible? If so, how? If someone can sketch out what the script needs to do, I can probably work out the details. I got as far as making a new button, turning off auto-hilite and get the selectedText. That works. What next? Thanks in advance, Tim___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution -- http://www.andregarzia.com All We Do Is Code. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
Thanks Andre! I think you might have misunderstood my request. What I want to do is pretty simple. I will manually locate web URLs, and hilite them manually. They are in plain text. Then I want to click a button that will turn the hilited plain-text URL into a clickable link. By clickable link I mean I want it to open the URL in my web browser. I tried: get the selectedText revGoUrl it That worked, to my amazement. Cool. Didn't know about RevGoUrl. OTOH, the docs say revGoUrl is deprecated. I'm not sure what to use instead. I want the same link to be clickable next time I come across it. I know how to set the textstyle of the selectedText to link, but that doesn't make it a clickable link. Hope that's clear. Tim On Nov 17, 2010, at 10:05 AM, Andre Garzia wrote: Tim, What you need to do is to loop your fields using a Regular Expression ( http://www.regular-expressions.info/ ) and MatchChunk to find out what chunks are URLs. Then you set the textstyle of those chunks to linktext. On the fields you intercept linkclicked and the clicked text will be the urls which you will be able to open with RevGoURL. Sorry but I can't help you with the RegEx, I am not that good with them and I don't have an URL extraction RegEx handy in here. I can try to cook something at some later time but right now it is not possible for me. Cheers andre ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
On 11/17/10 10:30 AM, Timothy Miller wrote: I tried: get the selectedText revGoUrl it That worked, to my amazement. Cool. Didn't know about RevGoUrl. OTOH, the docs say revGoUrl is deprecated. I'm not sure what to use instead. Try: get the selectedText launch url it -- Phil Davis PDS Labs Professional Software Development http://pdslabs.net ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
On Wed, Nov 17, 2010 at 4:30 PM, Timothy Miller gand...@doctortimothymiller.com wrote: Thanks Andre! I think you might have misunderstood my request. What I want to do is pretty simple. I will manually locate web URLs, and hilite them manually. They are in plain text. Then I want to click a button that will turn the hilited plain-text URL into a clickable link. By clickable link I mean I want it to open the URL in my web browser. o so it is easier than I thought I tried: get the selectedText revGoUrl it That worked, to my amazement. Cool. Didn't know about RevGoUrl. OTOH, the docs say revGoUrl is deprecated. I'm not sure what to use instead. I don't believe RevGoURL is deprecated. Oh My Lord Ganesha!!! It is deprecated... well, it is not the end of the world, it appears that they introduced launch url sometime during 2.9 and I missed it. So, use the selectedchunk. Something along the lines of: set the textstyle of the selectedchunk to linktext. Then, lock the text field so it is not editable anymore. Put a handler in it like on linkcliked pLink launch url pLink end linkclicked See if it works for you. cheers -- http://www.andregarzia.com All We Do Is Code. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
I see where you're going with this. First I need to point out, if the field doesn't have locktext set, don't think it will work, BUT, if it is.. For the plainest, simplest form, no validation or anything of that sort you can do the following. In the button you can put: on mouseUp set the textstyle of the selectedchunk to link end mouseUp And for the field: on mouseUp if the textstyle of the clickchunk is link then launch url the clicktext end if end mouseUp On Wed, Nov 17, 2010 at 11:36 AM, Phil Davis rev...@pdslabs.net wrote: On 11/17/10 10:30 AM, Timothy Miller wrote: I tried: get the selectedText revGoUrl it That worked, to my amazement. Cool. Didn't know about RevGoUrl. OTOH, the docs say revGoUrl is deprecated. I'm not sure what to use instead. Try: get the selectedText launch url it -- Phil Davis PDS Labs Professional Software Development http://pdslabs.net ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
Oh yeah. Do what andre said and use linkclicked. On Wed, Nov 17, 2010 at 11:36 AM, Andre Garzia an...@andregarzia.comwrote: On Wed, Nov 17, 2010 at 4:30 PM, Timothy Miller gand...@doctortimothymiller.com wrote: Thanks Andre! I think you might have misunderstood my request. What I want to do is pretty simple. I will manually locate web URLs, and hilite them manually. They are in plain text. Then I want to click a button that will turn the hilited plain-text URL into a clickable link. By clickable link I mean I want it to open the URL in my web browser. o so it is easier than I thought I tried: get the selectedText revGoUrl it That worked, to my amazement. Cool. Didn't know about RevGoUrl. OTOH, the docs say revGoUrl is deprecated. I'm not sure what to use instead. I don't believe RevGoURL is deprecated. Oh My Lord Ganesha!!! It is deprecated... well, it is not the end of the world, it appears that they introduced launch url sometime during 2.9 and I missed it. So, use the selectedchunk. Something along the lines of: set the textstyle of the selectedchunk to linktext. Then, lock the text field so it is not editable anymore. Put a handler in it like on linkcliked pLink launch url pLink end linkclicked See if it works for you. cheers -- http://www.andregarzia.com All We Do Is Code. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
On Nov 17, 2010, at 11:30 AM, Timothy Miller wrote: Thanks Andre! I think you might have misunderstood my request. What I want to do is pretty simple. I will manually locate web URLs, and hilite them manually. They are in plain text. Then I want to click a button that will turn the hilited plain-text URL into a clickable link. By clickable link I mean I want it to open the URL in my web browser. I tried: get the selectedText revGoUrl it That worked, to my amazement. Cool. Didn't know about RevGoUrl. OTOH, the docs say revGoUrl is deprecated. I'm not sure what to use instead. I want the same link to be clickable next time I come across it. I know how to set the textstyle of the selectedText to link, but that doesn't make it a clickable link. Hope that's clear. Tim, It's pretty simple: The link-making button: on mouseUp set the textStyle of the selectedChunk to link end mouseUp In the field that has the linked text: on linkClicked pTxt launch url pTxt end linkClicked That should do what you want. Regards, Devin Devin Asay Humanities Technology and Research Support Center Brigham Young University ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
ho ho ho I was going to say, do what Mike said... On Wed, Nov 17, 2010 at 4:40 PM, Mike Bonner bonnm...@gmail.com wrote: Oh yeah. Do what andre said and use linkclicked. On Wed, Nov 17, 2010 at 11:36 AM, Andre Garzia an...@andregarzia.com wrote: On Wed, Nov 17, 2010 at 4:30 PM, Timothy Miller gand...@doctortimothymiller.com wrote: Thanks Andre! I think you might have misunderstood my request. What I want to do is pretty simple. I will manually locate web URLs, and hilite them manually. They are in plain text. Then I want to click a button that will turn the hilited plain-text URL into a clickable link. By clickable link I mean I want it to open the URL in my web browser. o so it is easier than I thought I tried: get the selectedText revGoUrl it That worked, to my amazement. Cool. Didn't know about RevGoUrl. OTOH, the docs say revGoUrl is deprecated. I'm not sure what to use instead. I don't believe RevGoURL is deprecated. Oh My Lord Ganesha!!! It is deprecated... well, it is not the end of the world, it appears that they introduced launch url sometime during 2.9 and I missed it. So, use the selectedchunk. Something along the lines of: set the textstyle of the selectedchunk to linktext. Then, lock the text field so it is not editable anymore. Put a handler in it like on linkcliked pLink launch url pLink end linkclicked See if it works for you. cheers -- http://www.andregarzia.com All We Do Is Code. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution -- http://www.andregarzia.com All We Do Is Code. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
yes, Devin wins! On Wed, Nov 17, 2010 at 4:40 PM, Devin Asay devin_a...@byu.edu wrote: On Nov 17, 2010, at 11:30 AM, Timothy Miller wrote: Thanks Andre! I think you might have misunderstood my request. What I want to do is pretty simple. I will manually locate web URLs, and hilite them manually. They are in plain text. Then I want to click a button that will turn the hilited plain-text URL into a clickable link. By clickable link I mean I want it to open the URL in my web browser. I tried: get the selectedText revGoUrl it That worked, to my amazement. Cool. Didn't know about RevGoUrl. OTOH, the docs say revGoUrl is deprecated. I'm not sure what to use instead. I want the same link to be clickable next time I come across it. I know how to set the textstyle of the selectedText to link, but that doesn't make it a clickable link. Hope that's clear. Tim, It's pretty simple: The link-making button: on mouseUp set the textStyle of the selectedChunk to link end mouseUp In the field that has the linked text: on linkClicked pTxt launch url pTxt end linkClicked That should do what you want. Regards, Devin Devin Asay Humanities Technology and Research Support Center Brigham Young University ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution -- http://www.andregarzia.com All We Do Is Code. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
General rule of thumb. Never do what Mike says. All my friends see this as a life rule. If Mike thinks its a good idea, or even worse, if Mike came UP with the idea, its doomed DOOMED I TELL YOU! HAHAHAHAHAHAHA (you gotta imagine the cackles) ho ho ho I was going to say, do what Mike said... ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
Thankya, Devin, Andre, Phil and Mike. Very helpful. I get it now. Tim ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Please suggest script
Thankya, Devin, Andre, Phil and Mike. Your suggestions worked out even better than expected. I have a little padlock icon near one corner of the field. It locks and unlocks the field in question, to prevent accidental erasures. Normally, the field will be locked when I am reading its contents. When locktext is true, the field remains focusable. That means my new make link button works when the field is locked. As soon as the link is made, it is immediately clickable, unless I unlock the field. Perfect! Cheers, Tim___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution