Fill in a number, make a picture and send with e-mail
Posted: Sun Jun 23, 2013 2:55 pm
Hi,
I'm trying to create an app that let the user:
- fill in a number in a text entry field
then
- Capture a picture with the camera
then
Send this picture by e-mail to a predetermined e-mail address with the text entered in the 'text entry field' as a subject but with fixed text in front of the entered text. Attached to the e-mail the picture with the date and time as filename. The send from address must be from the default account of the user.
The text entry field must only accept numbers and dots.
- How can I add the dot as an accepted key?
- How can I limit the input field to max 9 characters?
For getting the picture I placed a button in the stack with the code below. I tried combining some of the code from the video tutorial to get a picture and upload it to an FTP. But I totally screwed up.
Now I have the code I found somewhere else on the forums to send a picture by e-mail;
But I'm totally lost in how to use it. Tried solving it by searching the documents and lessons I found on youtube but how to combine data into the mobileComposeMail is a total mystery for me.
To answer also a question you have after reading this; yes I'm trying to program
I'm trying to create an app that let the user:
- fill in a number in a text entry field
then
- Capture a picture with the camera
then
Send this picture by e-mail to a predetermined e-mail address with the text entered in the 'text entry field' as a subject but with fixed text in front of the entered text. Attached to the e-mail the picture with the date and time as filename. The send from address must be from the default account of the user.
The text entry field must only accept numbers and dots.
- How can I add the dot as an accepted key?
- How can I limit the input field to max 9 characters?
Code: Select all
on keyDown theKey
## Check whether theKey is a number or dot
if theKey is not a number or theKey is not a "." then
## If not beep to alert the user
beep
else
## If it is pass keyDown up the message path
## The engine will handle the message and the key will appear in the field
pass keyDown
end if
end keyDown
Code: Select all
on mouseUp
mobilePickPhoto "camera"
end mouseUp
Code: Select all
put tempPhoto into myData["file"]
put "image/jpg" into myData["type"]
put "File Name" into myData["name"]
mobileComposeMail "My subject", , , , "My body", myData
To answer also a question you have after reading this; yes I'm trying to program
