Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 11th, 2024, 11:20 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Google/Youtube search bar in Publication
PostPosted: May 9th, 2014, 10:36 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
Hi there.

Is there possibly a way to implement a search bar for either Youtube.com or Google.com, in which you can type in a search query (as if you were searching something on google/youtube) and when clicking a button, launches your browser to youtube/google with your inputted search and opens the relevant info for that search?
In other words:
Opus publication->type in search bar what you wish to search->search button->opens browser to relevant site (youtube/google) and displays your search.

If there is a way, please let me know. Hope my question is clear enough..

P.S
I am not to familiar with intense html, I only know the basics :3


For this message Animellarx has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Google/Youtube search bar in Publication
PostPosted: May 9th, 2014, 11:17 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
You just need to look at the URL for the website and then create that as string + your search term. So YouTube would be:

Code:
mySearchURL = "https://www.youtube.com/results?search_query=" + mySearchTerm;
window.open(mySearchURL, "_blank" );



The mySearchTerm is the variable from your Text Input Box

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Animellarx


Top
 Profile Visit website  
 
 Post subject: Re: Google/Youtube search bar in Publication
PostPosted: May 9th, 2014, 11:46 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
Hi and thanks Mack!

So I tried using this in my script:

Code:
mySearchURL = "https://www.youtube.com/results?search_query="
+ mySearchTerm; LaunchURL(mySearchURL)


It works perfectly but it opens two tabs of the same page. Do you know why perhaps?

Regards


For this message Animellarx has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Google/Youtube search bar in Publication
PostPosted: May 9th, 2014, 11:51 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
Never mind I had another action on the button, haha. It works perfectly now.


Thank you so much for the help! Appreciate it.

:D


For this message Animellarx has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Google/Youtube search bar in Publication
PostPosted: May 12th, 2014, 10:54 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
Hi again..

Using this script:

Code:
mySearchURL = "https://www.youtube.com/results?search_query="
+ mySearchTerm; LaunchURL(mySearchURL)


I noticed when I type in my text and add spaces between words for example: "Red roses" Opus opens a tab for each word after the space.
Though using the "-" instead of spaces fixes that problem.

Do you know what the problem is and how it can be resolved?
I have thought to have Opus replace any spaces with "-" before searching.. but "FindTextInSelection" and "ReplaceSelection" is not working that well.

Regards


For this message Animellarx has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Google/Youtube search bar in Publication
PostPosted: May 12th, 2014, 11:37 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Try replacing the spaces with plus (+):

Code:
myString = "red roses in May";
myNewString = myString.split(" ").join("+");
Debug.trace(myNewString)


Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Animellarx


Top
 Profile Visit website  
 
 Post subject: Re: Google/Youtube search bar in Publication
PostPosted: May 27th, 2014, 11:42 am 
Offline

Joined: July 5th, 2011, 2:51 pm
Posts: 44
Opus: Opus Pro 8
OS: Windows 10; 64-bit operating system
System: Intel(R) Core(TM) i5 CPU, 4.00GB (RAM)
Thanks again for the help Mack! It works perfectly.


Sorry about the late reply.

Kind regards
:)


For this message Animellarx has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group