Page 1 of 2 12 LastLast
Results 1 to 20 of 23
  1. jrfougere's Avatar
    Posts
    20 Posts
    Global Posts
    21 Global Posts
       #1  
    I put together a hack to allow me to send SMS messages super fast by tweaking global-search-assistant.jsjsjs. $Essentially$ $it$ $uses$ $the$ $same$ $functionality$ $as$ $a$ $global$ $search$, $but$ $uses$ $a$ $filter$ $to$ $let$ $you$ $do$ $a$ $global$ $search$. $This$ $is$ $very$ $similar$ $to$ $my$ $tweak$ $for$ $adding$ $keywords$ $to$ $search$ $engines$ ($available$ $at$ $the$ $bottom$ $of$: Patch Browser Global Search Addons - WebOS Internals)

    After you tweak global-search-address.jsjsjs $you$ $can$ $do$ $a$ $simple$ $text$ $message$ $by$ $just$ $typing$ $something$ $like$ &$quot$;$jf$ $hello$ $how$ $are$ $you$?&$quot$; $After$ $you$ $press$ $enter$ $you$ $will$ $be$ $taken$ $to$ $a$ $window$ $where$ $you$ $can$ $review$ $your$ $message$. $From$ $there$, $if$ $you$ $press$ $enter$ $twice$, $your$ $message$ $will$ $send$ $and$ $your$ $full$ $chat$ $conversation$ $with$ $the$ $contact$ $will$ $be$ $visible$. $The$ &$quot$;$jf$&$quot$; $part$ $will$ $tell$ $the$ $pre$ $who$ $you$ $want$ $to$ $text$ $and$ &$quot$;$hello$ $how$ $are$ $you$?&$quot$; $will$ $be$ $inputted$ $as$ $the$ $text$ $of$ $the$ $message$.

    So for example if I typed "jf what time is it?" and press enter, I will have an IM that is prepared with the text "what time is it?" to whoever I assign to "jf." Unfortunately, this is just a bare bones hack so you'll need to edit the file for each contact you would like to use. For me, I just copied the code for the 5 or so contacts for whom I wanted to be able to speed SMS. If somebody has any ideas as to how to make my code more user friendly , I would love to hear. I'm also not a pro with javascript so I doubt my code is optimized. In fact, it's entirely possible that some of these changes aren't even necessary. I just wanted to be on the safe side.

    Please keep in mind that I may have missed a bracket or comma, etc in my code snippets, so if something looks wrong, please let me know. I'm working on a global-search-assistant.jsjsjs $that$ $has$ $already$ $been$ $heavily$ $modified$, $so$ $I$ $may$ $not$ $have$ $caught$ $all$ $my$ $changes$. $It$ $may$ $take$ $some$ $trial$ $and$ $error$ $on$ $your$ $part$. $But$ $I$ $think$ $this$ $hack$ $is$ $worth$ $it$.

    Also, please be sure to backup your global-search-assistant.jsjsjs $before$ $you$ $do$ $any$ $tweaks$. $I$ $can$'$t$ $be$ $held$ $responsible$ $for$ $anything$ $that$ $gets$ $messed$ $up$



    Ok, on to the hack:

    1. Open for editing the following file: /usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.jsjsjs

    2. Find this code:

    Code:
    /**********messaging***********************/
      launchMessaging: function(contactId, contactPointId, serviceName, type) {
      	var params = {};
    	if(serviceName && type)
        	params = {"personId":contactId,"contactPointId":contactPointId, "serviceName":serviceName, "type":type}
    	else
    		params = {"personId":contactId,"contactPointId":contactPointId}
    	
    	ApplicationService.launch('com.palm.app.messaging', params);    
      },
    3. Add this code right after it:

    Code:
      launchMessagingxx: function(message) {
      	var params = {};
    	if(serviceName && type)
        	params = {composeAddress: '5554443333',messageText: message}
    	ApplicationService.launch('com.palm.app.messaging', params);    
      },
    where "xx" is the keyword you want to use to text. For example "jf test" sends a text with the message "test" to "jf"

    "5554443333" is the phone number you want to send it to. This phone number will be associated with "jf"

    From now on, wherever you see "xx" or "5554443333" in my code snippets, replace it with the keyword and phone number you want to use.


    4. Find this code:

    Code:
    /**********search***********************/
    	launchMap: function(querytext){
    		var params;
    		if (this.gpsInfo !== undefined)
    			params = {location: this.gpsInfo,query: querytext};
    		else
    			params = {location: "null",query: querytext};
    		
    		ApplicationService.launch('com.palm.app.maps', params);
    	},
    	
    	launchBrowser: function(url) {
    		var params = {scene: 'page', target: url};
    		ApplicationService.launch('com.palm.app.browser', params);		
    	},
    5. Add this code right after it:

    Code:
          launchMessagingxx: function(message) {
         	      var params = {composeAddress:'5554443333',messageText: message};
    		ApplicationService.launch('com.palm.app.messaging', params);    
           },
    6. Find this code:
    Code:
    				this.expandedSearchDrawer.showExpanded = true;
    				this.controller.modelChanged(this.expandedSearchDrawer);
    			}
    		} else {
    			var url = target.id;
    			if (url == "map"){
    				this.launchMap(this.currentFilter);
    			}
    			
    			else if (url == "web")
    7. Add this code right after it:

    Code:
                                if(this.currentFilter.substr(0,3) == "xx ") {
    					this.launchMessagingkn(this.currentFilter.substring(3));
    				}
    The reason it says ".substr(0,3)" is because the keywords i'm using only have 2 characters (plus a space). If you want to do something like "sms bill how are you" where your keyword is "sms bill" you'll need to change it to ".substr(0,9)" Likewise, if you want to change it to "m hi maria!" where your keyword is "m" you would change it to ".substr(0,2)"

    8. I have already edited my global-search-assistant so I'm not sure if this is in the original but you will probably then have to wrap an else around this.launchBrowser(this.currentFilter), which should be right after this part. Here is what the this.launchbrowser command should look like afterwards:

    Code:
    				else {
    					this.launchBrowser(this.currentFilter);
    				}
    9. Find the following text:

    Code:
    					case 'contact':
    						this.launchExistingContact(data.contactId);
    						break;		
    		        }
    		      }
    		    }
    			break;
    		case 'search':
    			this.highlightTarget.addClassName('selected');
    			if (this.webDrawer.showWeb == true)
    10. Add the following code after it:

    Code:
                                  if(this.currentFilter.substr(0,3) == "xx ") {
    					this.launchMessagingkn(this.currentFilter.substring(3));
    				}
    11. You will probably need to wrap an else around this.launchbrowser(this.currentFilter), which should be right after, so that it looks like this:

    Code:
    				else {
    					this.launchBrowser(this.currentFilter);
    				}
    12. Find this code:
    Code:
    	if (s.indexOf("www.") == 0)
    		return s;
    13. After it add this code:
    Code:
    	if(this.currentFilter.substr(0,3) == "xx ") {
    		return s;
    	}
    And that's it!

    If anybody has any thoughts for how I can optimize this or package it to be easy to install/modify, please let me know.

    Good luck.
  2. #2  
    this looks really promising
  3. #3  
    so this will speed up sms ?
    im gonna do this in a bit =]

    Donate Via Paypal to Email Adress: silent2205@gmail.com
    Email: fritos1406@aim.com
    Twitter: @fritos1406
  4. #4  
    I will try as soon as I get on the computer
  5. jrfougere's Avatar
    Posts
    20 Posts
    Global Posts
    21 Global Posts
       #5  
    I've been thinking a bit and perhaps the best way to easily implement this would be to somehow link it to your speed dial setting. That way you would only need to install the patch once then you can change the keywords/contacts very easily.

    Let me look more into this. If anybody has any ideas how to implement this, please let me know.
  6. #6  
    Screenshots???
    "Life is Hard... it's harder if your stupid"
    - John Wayne
  7. #7  
    still waiting for screenshots??? anyone working on this?
  8. #8  
    how do you get and edit the global-search-assistant.jsjsjs? $and$ $once$ $you$ $edit$ $it$ $how$ $do$ $you$ $get$ $it$ $to$ $your$ $pre$. $sorry$ $im$ $pretty$ $new$ $at$ $this$ $and$ $dont$ $know$ $anything$ $about$ $terminal$ $commands$ $and$ $all$ $that$
    Last edited by mikexmayhem; 10/28/2009 at 05:51 PM.
  9. #9  
    can anyone help me please
  10. #10  
    Quote Originally Posted by mikexmayhem View Post
    can anyone help me please
    open WebOS Quick Install and hit the tools tab and hit recieve file. In the file box paste /usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.jsjsjs

    then just choose where you want it to go. Then just open the file with wordpad and you can edit it from there
  11. #11  
    Quote Originally Posted by something13 View Post
    open WebOS Quick Install and hit the tools tab and hit recieve file. In the file box paste /usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.jsjsjs

    then just choose where you want it to go. Then just open the file with wordpad and you can edit it from there
    and to put it back i use 'send file' with the same location?
  12. #12  
    yes but you leave out the "global-search-assistant.jsjsjs &$quot$; $part$ $of$ $it$ $in$ $the$ $send$ $file$ $to$ $box$
  13. #13  
    right. thanks! i appreciate it
  14. #14  
    so after doing all the edits my search screen is now blank. can someone just upload a working global-search-assistant.jsjsjs $so$ $i$ $can$ $just$ $upload$ $it$ $to$ $my$ $phone$? $or$ $is$ $there$ $a$ $way$ $someone$ $could$ $help$ $me$ $out$
  15. #15  
    ok now it does open and recognize what im typing but wont launch
  16. #16  
    have you restarted your phone yet? Orange+SYM+R
    Did you remember to change the XX in the code to the numbers your wanted to be set up to text
  17. #17  
    yes and yes
  18. #18  
    I am not completely familiar with code, so like he said he may have missed some brackets in the code he uploaded. So that may be the problem. not really sure, sorry
  19. #19  
    its alright. have you done this? can you upload your .jsjsjs $file$ $so$ $i$ $can$ $compare$ $or$ $just$ $upload$ $yours$ $lol$. $changing$ $the$ $numbers$ $and$ $such$ $first$ $of$ $course$
  20. #20  
    sorry I haven't done it yet. I am waiting for a simpler way to do this.
Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions