Sending Commands to Comp from Phone through Mail Problem

okay so I want to be able to send commands to my computer from my phone. the best way I found to do this is via mail. so I would say send a email saying "weather Madison Wi" then it would recieve the email and send me the result. Problem is when i run the code it only pauses itunes then does nothing else. idk why. heres my code any help would be appreciated:
on performmailaction(info)
-- see if iTunes is playing
set itunes_playing to false
tell application "System Events"
if (get name of every process) does not contain "iTunes" then
set itunes_playing to false
else
tell application "iTunes"
if player state is playing then set itunes_playing to true
end tell
end if
end tell
-- pause iTunes if needed
if itunes_playing is true then tell application "iTunes" to pause
tell application "Mail"
set the_messages to |SelectedMessages| of info
repeat with a_message in the_messages
set the_sender to extract name from sender of a_message
set the_subject to extract name from subject of a_message
set the_content to extract name from content of a_message
if (junk mail status of a_message) is not true then
say "Mail from " & the_sender
if the_sender is "My Name here" then
if the_content contains "weather" then
get the second word of the_content
set s to the result
get the third word of the_content
set c to the result
set temp to get_temp(s, c)
set theNewMessage to make new outgoing message with properties {subject:"Weather", content:"Current temp is : " & temp & " in " & c & "," & s, visible:true}
tell theNewMessage
make new to recipient at end of to recipients with properties {address:"my sms number"}
send
end tell
end if
else
set theNewMessage to make new outgoing message with properties {subject:"New Mail", content:"New Mail From: " & the_sender, visible:true}
tell theNewMessage
make new to recipient at end of to recipients with properties {address:"[email protected]"}
send
end tell
end if
end if
end repeat
end tell
-- resume iTunes if it was playing before
if itunes_playing is true then tell application "iTunes" to play
end performmailaction
on get_temp(stat, cit)
tell application "Safari"
activate
set state to stat
set town to cit
set URL of document 1 to "http://www.findlocalweather.com/forecast/" & state & "/" & town & ".html"
set page to text of document 1 as string
set pos to offset of "Temp:   " in page
set final_pos to the offset of "°F" in page
set pos to pos + 8
set temp to characters pos thru (final_pos - 1) of page as string
quit
return temp
end tell
end get_temp

I'm not sure why you think you need to pause iTunes as part of the script, but I'll leave that for now.
The problem may be that Mail.app cannot send a new message while it's processing a rule via AppleScript. There are numerous discussions about this, both here and elsewhere, so it may well be that there's nothing wrong with your script, it's just how it is. Take a look at this thread for some suggestions.

Similar Messages

  • Mailing photos from iphoto through mail

    When I mail photos from iphoto through mail, it sends the picture at very low resolution regardless of the setting I choose (small, medium, large, actual). How can I send photos to others at viewing or even printing quality? Can I resize the pictures to my specifications as I used to be able to do on my PC? Through ACDSee I could resize to 50% which would be small enough to send quickly but still high enough quality for the recipients to view and even print. Thanks!

    drjoan
    After iPhoto has created a new Mail message have a look at the bottom right hand corner of the Mail Message window - there's another control there for sizing the pics... try play with that one to find the size you require.
    You can access your photos for sending in Mail too. In the New Mail Message Window there's an icon on the toolbar that will show you your iPhoto library.
    Regards
    TD

  • Sending command to a mobile phone blugged into a pc to send an sms

    hi.
    i am new to this field, but i heard of "at command" that are helpful to control the mobile phone from a pc. And Java supports this...
    this is the case:
    1- a mobile with a valid sim card is connected via USB with the pc.
    2- an application is running at the pc (java application)
    on this application we need to add a module/class that sends command "at command" to our connected mobie with 2 parameters:
    1- the phone number
    2- the message
    MyClass.sendViaMobile("+962795940824", "we want to inform you that u got the help :-)");what i need is how to start this, what do i need to know,and what api's i need to use
    regards,
    bilal
    Message was edited by:
    bilal_RD

    hi mlk
    i found the rxtx api, but i got now a question,
    how to connect to a usb port?
    it seems that it is easy to deal with com port or serial port, but until this moment usb didnt work,
    in my case, the mobile is connected via usb port.
    this a code that uses the RXTX API, whaere do i need to modify to connect using usb?
    *note, the following code is written by someone else, it works via com port...
    //     SendMessage.java - Sample application.
    //          This application shows you the basic procedure needed for sending
    //          an SMS message from your GSM device.
    //     Include the necessary package.;c:\classpath\smslib.jar;c:\classpath\comm.jar
    package examples;
    import org.smslib.*;
    class SendMessage
         public static void main(String[] args)
              // Define the CService object. The parameters show the Comm Port used, the Baudrate,
              // the Manufacturer and Model strings. Manufacturer and Model strings define which of
              // the available AT Handlers will be used.
              CService srv = new CService("COM1", 19200, "Nokia", "6630");
              System.out.println();
              System.out.println("SendMessage(): Send a message.");
              System.out.println("  Using " + srv._name + " " + srv._version);
              System.out.println();
              try
                   // If the GSM device is PIN protected, enter the PIN here.
                   // PIN information will be used only when the GSM device reports that it needs
                   // a PIN in order to continue.
                   srv.setSimPin("0000");
                   // Normally, you would want to set the SMSC number to blank. GSM devices
                   // get the SMSC number information from their SIM card.
                   srv.setSmscNumber("");
                   // OK, let connect and see what happens... Exceptions may be thrown here!
                   srv.connect();
                   // Lets get info about the GSM device...
                   System.out.println("Mobile Device Information: ");
                   System.out.println("     Manufacturer  : " + srv.getDeviceInfo().getManufacturer());
                   System.out.println("     Model         : " + srv.getDeviceInfo().getModel());
                   System.out.println("     Serial No     : " + srv.getDeviceInfo().getSerialNo());
                   System.out.println("     IMSI          : " + srv.getDeviceInfo().getImsi());
                   System.out.println("     S/W Version   : " + srv.getDeviceInfo().getSwVersion());
                   System.out.println("     Battery Level : " + srv.getDeviceInfo().getBatteryLevel() + "%");
                   System.out.println("     Signal Level  : " + srv.getDeviceInfo().getSignalLevel() + "%");
                   // Lets create a message for dispatch.
                   // A message needs the recipient's number and the text. Recipient's number should always
                   // be defined in international format.
                   IOutgoingMessage msg = new COutgoingMessage("+5550000", "Message from SMSLib for Java.");
                   // Set the message encoding.
                   // We can use 7bit, 8bit and Unicode. 7bit should be enough for most cases. Unicode
                   // is necessary for Far-East countries.
                   msg.setMessageEncoding(IMessage.MESSAGE_ENCODING_7BIT);
                   // Do we require a Delivery Status Report?
                   msg.setStatusReport(true);
                   // We can also define the validity period.
                   // Validity period is always defined in hours.
                   // The following statement sets the validity period to 8 hours.
                   msg.setValidityPeriod(8);
                   // Do we require a flash SMS? A flash SMS appears immediately on recipient's phone.
                   // Sometimes its called a forced SMS. Its kind of rude, so be careful!
                   // Keep in mind that flash messages are not supported by all handsets.
                   // msg.setFlashSms(true);
                   // Some special applications are "listening" for messages on specific ports.
                   // The following statements set the Source and Destination port.
                   // They should always be used in pairs!!!
                   // Source and Destination ports are defined as 16bit ints in the message
                   // header.
                    msg.setSourcePort(10000);
                    msg.setDestinationPort(50000);
                   // Ok, finished with the message parameters, now send it!
                   // If we have many messages to send, we could also construct a LinkedList with
                   // many COutgoingMessage objects and pass it to srv.sendMessage().
                   srv.sendMessage(msg);
                   // Disconnect - Don't forget to disconnect!
                   srv.disconnect();
              catch (Exception e)
                   e.printStackTrace();
              System.exit(0);
    }

  • Send RFQ as an PDF attachment through mail

    Hi All,
      I wanna send the quotation format to multiple vendors in PDF through mail.
    I have developed RFQ using smartforms.
    Please lemme know how to do this and wat r the steps to be taken.
    Regards,
    Priya

    Hello,
    you only need to convert your smartform into PDF and next send.
    The sending can be seen for example here:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c2567f2b-0b01-0010-b7b5-977cbf80665d
    or you can just search for the sending code, you will find something like this:
    http://monoceros85.blogspot.com/2009/04/send-email-in-abap-using-class-clbcs.html
    Email using cl_bcs
    Or direct example is here:
    Multiple PDF attachments using CL_BCS Class
    Regards, Otto
    p.s.: please search the next time first and ask later

  • Sending Customer ,Dunning and Payment Advices through Mail

    hi to all
    help me inthis issue
    for Customer,Dunning and Payment Advices i need to send it through mail to customers and vendors.
    for example when we run F.27 Transaction the customer statemnts should be mailed to customer directly
    thanks in advance
    kiran reddy
    Message was edited by:
            Kiran Reddy
    Message was edited by:
            Kiran Reddy
    Message was edited by:
            Kiran Reddy
    Message was edited by:
            Kiran Reddy
    Message was edited by:
            Kiran Reddy
    Message was edited by:
            Kiran Reddy

    Yeah ,
    This will be maintianing a output type for a specific order in the Nace Configuarations for output type for the application say in ur case Payment advices.
    Here u need to maintain a program name (driver program) and a form routine as Entry in the processing routines .
    You  need to write the logic in this driver program which is a Zprogram.
    Now when ever the application is run the output type is enabled and so the driver program will execute the logic pertaining to the entries created by ur transaction.
    can achieve this  with  SO_OBJECT_SEND for the customer id  .
    hope this gives u an idea ..
    i dont know about payment advices so can t elaborate more than this but the process will be same.
    regards,
    vijay

  • Auto PO creation from PR through ME58 problem.

    Hi experts.
    We are providing facility to our client  auto po creation from PR through Me58 transaction code.
    I am facing amazing problem is that it is working fine in development client , not working in Quality and  Production client , exactly  problem is that ME58 u2013 Ordering Assigned Purchase requisition  & Process Assignment  Create PO , Purchase order cannot be created, PR  shift in document overview , it means user want to drag and drop in purchase order then system create PO , this problem I am facing in Quality & Production , but it is working fine in development server there is no need to drag and drop , immediately after Process assignment Create PO , system directly convert PR into PO  just only need to check and save PO. I compare everything with development & quality data including material master , source list and everything still I am unable to understand where is the problem , is there any customization settings related to auto po ?  pls. suggest any solution to solve this issue.
    Kumar

    Hi,
    Config setting.
    Settings for Automatic PO creation is:
    1. Select the Automatic PO check box/option in Purchasing view of material master
    2. Select the Automatic PO option in the purchasing data view of Vendor master
    3. Maintain Purchase info record
    4. ME56- Assign the vendors to PR's
    5. ME58- Create PO via assignment list(PR-> PO)
    6. ME57- Assign and process PR's
    7. ME59N - Create PO automatically via PR
    Above step by step procedure is involved in the Automatic PO creation.
    SAM

  • I cant send mail from my through mail

    I have an email account with virgin, brought it through and i recieve mail but i am not able to send mail, not sure why?

    Isn't mail.virgin.net the name of the Incoming Server -- the incoming server, which you say is working is set up at Mail Preferences/Accounts/Account Information as to name of the server, Username, and password, along with entries in Mail Preferences/Accounts/Advanced for Port select for the Incoming.
    However, if that is working for you, you must have it correct. For the Outgoing server, isn't the proper name for Virgin services smtp.virgin.net? In Mail Preferences/Accounts/Account Information, click on the arrows beside the name of the SMTP, and choose Edit Server List. Remove all, or all but one of any references to the smtp.virgin.net. Enter anew, or with the remaining server, click on the Advanced Tab there, and choose Use Custom Ports. Then enter the Custom Port to be Port 25, and set the Authentication to None, and have no entries in Username or Password. This is consistent with those specs I can online saying the SMTP does not require Authentication.
    Also click Use this server only. Now if the smtp.virgin.net server is online, it should work.
    Ernie

  • Can send but not receive from .mac using Mail

    I've a problem that pre-dates the mobile me change where the Mail application won't download mail from my .mac account. The most recent email downloaded was from three months ago and since then I have had the tilde character showing next to my .mac account indicating there is a problem.
    I have no problem sending mail from my .mac account, and emails from other non .mac accounts are downloaded without any problem. Webmail is ok - previously in .mac and now in mobile me and until now I've been logging in that way hoping it will resolve itself, but obviously it hasn't done.
    Any help or pointers will be gratefully received.
    Thanks
    Andrew

    Hello,
    All dot.Mac and Dot.Me account have migrated to iCloud.
    You should have been given details of expiry for the .Mac account to iCloud. Apple have now shut .Me and .Mac account for web access.
    Check this discussion which may help. https://discussions.apple.com/thread/3966411?start=0&tstart=0

  • Cannot send files via bluetooth from phone to PC

    Dear All,
    I am having a problem trying to send files from my E71 to a PC.
    I can send files from my PC's (both Ubuntu & Windows) no problem but if I try to send a file from my E71 (i have tried both a pdf, picture & video) the phone just says "Sending failed".
    I can browse the phone via blueetooth in both Ubuntu and Windows so i know the connectivity is there. Both Ubuntu and Windows have the options set to allow incoming file transfers.
    Is this normal behaviour? Has anybody else experienced this problem or seen anything else about this?
    COM

    Hi Com,
    which Bluetooth stack are you running under Windows?
    I know that with the M$ stack, you explicitly need to right-click on the BT icon and choose "Receive a File". I have successfully used this before to get files from my E71.
    Regards,
    Dane
    Proud E71-1 owner (yeah!)

  • HT201415 cannot send and receive imessages from phone number. Will not allow number to be ticked

    Cannot send and received imessages through phone numer.  Will not allow me to tick number

    Turn off iMessage and turn it back on.

  • Airdrop,,Using,Phone,5's,,8.1.1,,and,Mac,Book,pro,early,2011,,OS,X,Yosemite:,try ing,to,send,photo,via,airdrop,FROM,phone,to,computer,,but,airdrop,does,not,find, computer,even,3,inches,away;,WWII,and,bluetooth,are,enabled.,Solution?

    Airdrop solution needed! Using iPhone 5s, 8.1.1, and MacBook Pro early 2011, OS X Yosemite 10.10.1, cannot get iPhone to pickup airdrop signal for computer to send photos from iPhone to computer. WiFi and Bluetooth are enabled.

    adamboettiger wrote:
    Sophos and MacKeeper
    There are many reported problems with both these programs.
    Run through this list of fixes in order, will tune you right up.
    They are in order for a reason.
    ..Step by Step to fix your Mac

  • Problem in sending the Smartform Output as PDF through Mail

    Dear All,
    I am sending the Smartform Output as an attachment by converting it into PDF. But when I am recieve this attachment I am unable to open the PDF file, it is giving error that FILE IS DAMAGED. Below is the code:
    REPORT  Y_SEND_MAIL2.
    TABLES: vbrk, vbrp.
    TYPE-POOLS: abap.
    DATA: it_vbrk TYPE TABLE OF vbrk WITH HEADER LINE.
    DATA: i_formname      TYPE       tdsfname,
          i_fm_name       TYPE       rs38l_fnam,
          it_vbak TYPE TABLE OF vbak WITH HEADER LINE,
          it_ekko TYPE TABLE OF ekko WITH HEADER LINE.
    DATA:  is_bil_invoice TYPE lbbil_invoice,
           output_options      TYPE ssfcompop,
           control_parameters  TYPE ssfctrlop,
           e_devtype           TYPE rspoptype,
           job_output_info     TYPE ssfcrescl,
           bin_file            TYPE xstring,
           lines               TYPE TABLE OF tline WITH HEADER LINE,
           doctab_archive      TYPE TABLE OF docs WITH HEADER LINE,
           filelength          TYPE i,
           bin_filesize        TYPE i,
           docs          TYPE TABLE OF docs WITH HEADER LINE.
    *"Types
    TYPES: t_document_data TYPE sodocchgi1,
           t_packing_list TYPE sopcklsti1,
           t_attachment TYPE solisti1,
           t_body_msg TYPE solisti1,
           t_receivers TYPE somlreci1,
           t_pdf TYPE tline.
    *"Workareas
    DATA :w_document_data TYPE t_document_data,
          w_packing_list TYPE t_packing_list,
          w_attachment TYPE t_attachment,
          w_body_msg TYPE t_body_msg,
          w_receivers TYPE t_receivers,
          w_pdf TYPE t_pdf.
    *internal tables
    DATA : i_document_data TYPE STANDARD TABLE OF t_document_data,
           i_packing_list TYPE STANDARD TABLE OF t_packing_list,
           i_attachment TYPE STANDARD TABLE OF t_attachment,
           i_body_msg TYPE STANDARD TABLE OF t_body_msg,
           i_receivers TYPE STANDARD TABLE OF t_receivers,
           i_pdf TYPE STANDARD TABLE OF t_pdf.
    DATA: BEGIN OF line_bin,
             data(1024) TYPE x,
          END OF line_bin.
    DATA: data_tab_bin LIKE STANDARD TABLE OF line_bin.
    So please suggest a solution.
    Regards,
    Vishal

    Continued:
    SELECT-OPTIONS: s_vbeln FOR vbrk-vbeln,
                    s_fkdat FOR vbrk-fkdat OBLIGATORY DEFAULT sy-datum.
    SELECT * FROM vbrk
    INTO TABLE it_vbrk
    WHERE fkdat IN s_fkdat
          AND vbeln IN s_vbeln.
    i_formname = 'Z_SD_JINDAL_INVOICE10'.
    output_options-tddest        = 'LP02'.
    output_options-tdimmed       = 'X'.
    output_options-tdnewid       = 'X'.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = i_formname
      IMPORTING
        fm_name            = i_fm_name
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    IF sy-subrc <> 0.          "checking subrc
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.                     "IF sy-subrc <> 0
    READ TABLE it_vbrk INDEX 1.
    IF sy-subrc = 0.
      is_bil_invoice-hd_gen-bil_number = it_vbrk-vbeln.
    ENDIF.
    control_parameters-no_dialog = 'X'.
    control_parameters-getotf = 'X'.
    CALL FUNCTION i_fm_name        "'/1BCDWB/SF00000097'
      EXPORTING
       control_parameters         = control_parameters
       output_options             = output_options
       user_settings              = space
       is_bil_invoice             = is_bil_invoice
    IMPORTING
       job_output_info            = job_output_info
    TABLES
       it_vbak                    = it_vbak
    EXCEPTIONS
       formatting_error           = 1
       internal_error             = 2
       send_error                 = 3
       user_canceled              = 4
       OTHERS                     = 5.
    IF sy-subrc <> 0.
    *      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *FORM convert_otf_2_pdf.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
    *      EXPORTING
    *        USE_OTF_MC_CMD               = 'X'
    *        ARCHIVE_INDEX                =
        IMPORTING
          bin_filesize                 = bin_filesize
        TABLES
          otf                          = job_output_info-otfdata[]
          doctab_archive               = docs[]
          lines                        = lines[]
        EXCEPTIONS
          err_conv_not_possible        = 1
          err_otf_mc_noendmarker       = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    *      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *ENDFORM.                    "convert_otf_2_pdf

  • Problem in sending the file as an attachment through mail

    Hi,
    I have developed a Zreport. The functionality is like on executing this report it should send an e-mail with an attachment of the data in the xcel format.
    So, while execting this report in background mode in ECC 5.0, it is able to send the mail as an attachment but the file doesn't contain the data in it But, the same report while trying to execute in back ground mode in ECC 6.0, it is able to send the mail with the attachment and the file also has the data.
    So, my question is like are there any patches that has to be installed in ECC 5.0 system to get this successfully done.
    Thanks in advance for your answers.
    Rohith

    Hello,
    Are you using the standad sap function module or using OLE objects to generate excel?
    First try creating the excel file in foreground and see if the data is being populated.
    Kind Regards,
    Niky.

  • Streaming from phone through TV

    On a Android phone can you use the transfer/charge cable to stream movies/youtube etc. to the USB input on your TV? I know it would depend on the TV and possible what version of the android os but has anybody tried it? My phone doesn't have a micro hdmi output to use.
    Thanks

    If the TV could mount the phone as a USB device it could probably play movies...not true streaming but it might work.

  • Can't open or send gmail any longer from phone

    When I try to send or receive email, I am prompted to enter the username associated with the smartphone.. When I put in my user name and password, I am looped into the same message asking me to enter the username and password. Please help!

    i think you need to reset your blackbaerry passport

Maybe you are looking for