Page 1 of 1

Access to iOS clip board

Posted: Sun Feb 28, 2016 6:32 pm
by trags3
Hi, is there an external or some other method to access the clip board on an iPhone or iPad?

Thanks
Tom

Re: Access to iOS clip board

Posted: Sun Feb 28, 2016 6:58 pm
by quailcreek
Hi Tom,
I don't mean to answer a question with a question but... well yes I do. What is it that you're trying to accomplish?

Re: Access to iOS clip board

Posted: Sun Feb 28, 2016 10:40 pm
by trags3
Hi Tom,
I have an app that the user uses to enter a relatively small amount of information. They may get a text with a name and email address and wish to copy that and paste it into my app at the appropriate place.
I don't know how to do that and I was told somewhere sometime ago that access to the clipboard was verboten.

Tom

Re: Access to iOS clip board

Posted: Sun Feb 28, 2016 11:18 pm
by quailcreek
Oh... pretty simple. You need to use a native input control where they will be pasting. Look up mobileControlCreate input. It will give you the paste option when you hold down in the control. This is what i use. Probably more then you need but it should get you stared. I use a rectangle graphic for the rect. Here it's named Search_Rect. That's where your input control with be. If you're only creating one input control this is overkill but if you have several it's a real time saver.

Code: Select all

inputCreator "Search", "input", "Search_Rect", "TRUE", "TRUE", "None", "No", "Default”,”Default,,”Left"

on inputCreator pName, pKind, pRect, pAutoClear, pAutoFit, pAutoCap, pAutoCorrect, pKeyboardType, pReturnKey, pBackgroundColor, ptextAlign
   mobileControlCreate pKind, pName
   mobileControlSet pName, "visible", true
   mobileControlSet pName, "rect", the rect of grc pRect
   mobileControlSet pName, "opaque", false
   mobileControlSet pName, "autoFit", pAutoFit
   mobileControlSet pName, "autoClear", pAutoClear
   mobileControlSet pName, "autoCapitalizationType", pAutoCap
   mobileControlSet pName, "autoCorrectionType", pAutoCorrect
   mobileControlSet pName, "keyboardType", pKeyboardType
   mobileControlSet pName, "returnKeyType", pReturnKey
   mobileControlSet pName, "clearButtonMode", "while editing"
   mobileControlSet pName, "borderStyle", "none"
   mobileControlSet pName, "fontName", "Helvetica"
   mobileControlSet pName, "textColor", "0,0,0"
   mobileControlSet pName, "backgroundColor", pBackgroundColor
   mobileControlSet pName, "textAlign", ptextAlign
   
   if machine() contains "ipad" then
      mobilecontrolSet pName, "fontSize", 26
   else if machine() contains "iPhone" then 
      mobilecontrolSet pName, "fontSize", 12 -- (aval)
   else
      mobilecontrolSet pName, "fontSize", 12
   end if
end inputCreator

Re: Access to iOS clip board

Posted: Mon Feb 29, 2016 12:14 am
by trags3
Thanks Tom,
I'll check this out this evening.
I really appreciate your help.
Tom