Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms 5 › Reading clipboard in a script
Tagged: Scripting
- This topic has 6 replies, 2 voices, and was last updated 7 years ago by
Martin Kendall.
-
AuthorPosts
-
October 6, 2018 at 12:06 PM #30930
Martin KendallParticipantIs 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 importanceOctober 6, 2018 at 10:32 PM #30934
BrendanKeymasterHi 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
October 7, 2018 at 6:52 AM #30940
Martin KendallParticipantThat’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
October 7, 2018 at 5:30 PM #30943
BrendanKeymasterHi 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
October 7, 2018 at 11:15 PM #30946
Martin KendallParticipantThank 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?
October 7, 2018 at 11:27 PM #30949
BrendanKeymasterYes that’s right. It’s good for showing the results of running a script. It’s displayed asynchronously after the script executes.
October 7, 2018 at 11:27 PM #30950
Martin KendallParticipantActually 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.
-
AuthorPosts
You must be logged in to reply to this topic.