Is it possible for a JavaScript script to read the iOS clipboard?
I like to quickly note new entries in plain text in other apps (e.g. Drafts). I know there isn’t a full Tap Forms URL scheme at the moment, but the ability to run a form script that creates a record from the clipboard contents would be fantastic.
I hope it is possible,
Martin
Ps Setting the clipboard too would be great to send data to other apps, but that is of lesser importance
Hi Martin,
I haven’t written any code to enable access to the clipboard. I’m not sure that JavaScript directly allows that so I would have to write some Objective-C code that allows access to it.
Thanks,
Brendan
That’s a shame. Fingers crossed you can add it someday.
I did think of trying promptForInputParameters and then pasting in my clipboard. Sadly this doesn’t seem to work on the iPad. I also couldn’t get alertWithMessage to work on the iPad.
Are only a subset of functions supported on the iOS version?
Thanks
Martin
Hi Martin,
The promptForInput function was an old function that is no longer there for Mac or iOS. I inadvertently forgot to update the manual with the new Prompter() class API. I’ve fixed the documentation for that now. But I still have to implement that on the iOS version
The Utils.alertWithMessage('Script Run Complete!', 'Cool!!!!!');
function should work on iOS though. I just tested it and it does work.
Thanks!
Brendan
Thank you. I have tried:
Utils.alertWithMessage("almost done", record);
And it puts up a dialog box, but the script doesn’t continue after pressing OK.
Is it only intended to be used at the end of a script?
Yes that’s right. It’s good for showing the results of running a script. It’s displayed asynchronously after the script executes.
Actually the script does seem to be running, but a second call to alertWithMessage isn’t showing, nor is the final “success” dialog.
I will have to investigate further.