what's wrong with this code

Discussion in 'Mac Programming' started by Airlok apps, Aug 9, 2011.

  1. Airlok apps macrumors newbie

    Joined:
    Jul 25, 2011
    #1
    what is wrong with this applescript in Xcode
    Code:
     
       property textView : missing value
    	property textField : missing value
        property textView1 : missing value
    	property textField1 : missing value
        property textView2 : missing value
    	property textField2 : missing value
      
        on mail1_(sender)
            set textFieldValue to textField's |stringValue|()
            set textviewvalue to textview's string()
        tell application "Mail"
            set theMessage to make new outgoing message with properties {visible:false, subject:textFieldValue, content:textviewvalue}
            tell theMessage
                make new to recipient at end of to recipients with properties {name:"example", address:"example@example.com"}
                send theMessage
            end tell
        end tell    
    end mail1_
        
        on mail2_(sender)
           set textFieldValue1 to textField1's |stringValue|()
            set textviewvalue1 to textview1's string()
            tell application "Mail"
                set theMessage to make new outgoing message with properties {visible:false, subject:textFieldValue1, content:textviewvalue1}
                tell theMessage
                    make new to recipient at end of to recipients with properties {name:"example", address:"example@example.com"}
                    send theMessage
                end tell
            end tell    
        end mail2_
        
        on mail3_(sender)
           set textFieldValue2 to textField2's |stringValue|()
            set textviewvalue2 to textview2's string() 
            tell application "Mail"
                set theMessage to make new outgoing message with properties {visible:false, subject:textFieldValue2, content:textviewvalue2}
                tell theMessage
                    make new to recipient at end of to recipients with properties {name:"example", address:"example@example.com"}
                    send theMessage
                end tell
            end tell   
        end mail3_
    
     
  2. mijail macrumors 6502

    Joined:
    Oct 31, 2010
    #2
    I'm sure the compiler will tell you.
    If you already tried compiling, let us know the result.

    Hint: make it easy for others to help you.
     
  3. Airlok apps thread starter macrumors newbie

    Joined:
    Jul 25, 2011
    #3
    when i try to send the message i get:
    Can’t get string {} of «class ocid» id «data kptr20059C01». (error -1728)
     

Share This Page