ADB Shell Comand or Script | Clipboard

MO
Marco Olberts
Flughafen München

Hi everyone,

I’m looking for a script that can copy specific data/variables like %Phonenumber% to the clipboard.

Does anyone have an idea how to fix this?

7 months ago
Android Scripting
ANSWERS
ZC
Zafer Cigdem
7 months ago

Hi Marco,

With this limited information I can share one alternative, by using JS for Android devices, you can read data from the file by specify the file's path as following example (.ini file as an example only, you can also use .json, .txt or etc. as well) :


var count = new mobicontrol.io.File('/sdcard/Download/user_name.ini');

var text_read = count.readText();

mobicontrol.log.info('Read info is:' +text_read);


And then you can store and get action by using this data. If this does not work for you, please share your use-case; what is your goal and what do you do by using this to let us help you with our best. Thank you

Zafer

ZC
Zafer Cigdem
7 months ago
RS
Rafael Schäfer
7 months ago

To which clipboard you mean? (the one from the phone or from the console user)

RC
Raymond Chan Diamond Contributor
6 months ago

Hi Marco,

Please elaborate your use case.  Is everything run within MobiControl Kiosk mode?  How will the script get initiated? 

If some required data is in the clipboard, how will it be consumed (e.g interactively by device end-user or automatically by a running app/service)?   How frequently? Or how quickly the response should be?  All these may affect whether the data should be passed via clipboard in the first place.

MO
Marco Olberts
6 months ago

Hello everyone,

thanks for the input.

The issue is that the current phone number of the device needs to be entered into an application, unfortunately, every time it's used. The idea was that there would be a script in kiosk mode that copies the system variable %Phonenumber% to the clipboard, and the user would just need to go to the field and select paste. Currently, we have a workaround where the phone number is displayed on the Dynamic Lockdown screen, we copy it, and then manually enter it into the application.

There’s probably also a solution here with JavaScript, as Zafer describes. I just thought maybe someone has a simple, quick idea :)

A
ABMOD@SOTI
6 months ago

Hi Marco,
Thanks for posting on SOTI Pulse, Thanks Zafer, Rafael and Raymond for responding to the post, your expertise and willingness to help are greatly appreciated!

We request you to please raise a support case at log a case so that our agent can work on your query as quickly as possible.