Results 1 to 4 of 4
  1.    #1  
    EDIT: DON'T USE MY CODE! There is a much simpler solution in the first reply!

    ===============

    I wrote this shell script this morning to send txt messages from an ssh session so that i can type on my full size keyboard when I'm at my desk.

    Code:
    #!/bin/sh
    echo "luna-send `more /media/internal/txtfront.txt`$1`more /media/internal/txtmid.txt`$2`more /media/internal/txtend.txt`" >/media/internal/txt.txt
    echo /media/internal/txt.txt | /bin/sh
    The txt files referenced are the parts before, between, and after the two values you have to change in the txt messaging line of the luna-send reference over at webos internals. (sorry, i couldn't post a link due to my low post count)

    The usage is:
    txt.sh ########## "message to send"
    where the bangs represent the 10-digit phone number to send to.

    And yes it does work.

    /discuss

    /improve
    Last edited by the1williegeorge; 11/09/2010 at 08:31 PM. Reason: Simpler solution
  2. #2  
    This seemed simpler, just paste this in txt.sh and then usage is the same,

    sh txt.sh 1231231234 message

    Code:
    #!/bin/sh
    luna-send -n 1 palm://com.palm.messaging/sendMessageFromCompose '{"recipientJSONArray": [{"lastName": "", "pictureLoc": "", "contactCount": 1, "displayText": "", "firstName": "", "pictureLocBig": "", "imAvailability": 6, "pictureLocSquare": "", "contactDisplay": "", "Person_id": "", "personId": "", "type": "phone", "value": "'$1'", "alreadyValidated": true, "prefix": "to$A", "identifier": ""}], "messageText": "'$2'"}'
    This is a really cool idea, I had never thought of doing this with my phone before. This is the link to the webos internals page I think you were refering to: Luna Send - WebOS Internals
  3.    #3  
    THAT'S how you do that! I kept getting messages consisting of $2 going to numbers of $1. I had no idea where I should be putting those extra single quotes.

    THANKS!
  4. mauro1's Avatar
    Posts
    205 Posts
    Global Posts
    213 Global Posts
    #4  
    How about this approach, to avoid having to quote the message. Also take opportunity to remind the user the Usage.

    Code:
    #!/bin/sh
    if [ $# -lt 2 ] ; then 
    	echo "Usage: ${0##*/} Destination Message"
    else
    	destination=$1
    	shift 1
    	message=$*
    	luna-send -n 1 palm://com.palm.messaging/sendMessageFromCompose '{"recipientJSONArray": [{"lastName": "", "pictureLoc": "", "contactCount": 1, "displayText": "", "firstName": "", "pictureLocBig": "", "imAvailability": 6, "pictureLocSquare": "", "contactDisplay": "", "Person_id": "", "personId": "", "type": "phone", "value": "'$destination'", "alreadyValidated": true, "prefix": "to$A", "identifier": ""}], "messageText": "'$message'"}'
    fi
    Last edited by mauro1; 11/09/2010 at 09:08 PM. Reason: not a quote, but code.
    Palm Pilot -> IBM WorkPad -> Handspring Visor -> Palm VIIx -> Palm T|X -> Palm Pre -> US GSM Palm Pre 2 [shelved] and 16GB HP TouchPad [died] -> (Samsung GNex and 32GB HP Touchpad with CM9)

Posting Permissions