Access to iOS clip board

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trags3
Posts: 432
Joined: Wed Apr 09, 2014 1:58 am

Access to iOS clip board

Post by trags3 » Sun Feb 28, 2016 6:32 pm

Hi, is there an external or some other method to access the clip board on an iPhone or iPad?

Thanks
Tom

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Access to iOS clip board

Post by quailcreek » Sun Feb 28, 2016 6:58 pm

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?
Tom
MacBook Pro OS Mojave 10.14

trags3
Posts: 432
Joined: Wed Apr 09, 2014 1:58 am

Re: Access to iOS clip board

Post by trags3 » Sun Feb 28, 2016 10:40 pm

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

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Access to iOS clip board

Post by quailcreek » Sun Feb 28, 2016 11:18 pm

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
Tom
MacBook Pro OS Mojave 10.14

trags3
Posts: 432
Joined: Wed Apr 09, 2014 1:58 am

Re: Access to iOS clip board

Post by trags3 » Mon Feb 29, 2016 12:14 am

Thanks Tom,
I'll check this out this evening.
I really appreciate your help.
Tom

Post Reply