Need help in copying file on clipboard

Hi,

Kindly help with the following problem:

I want to copy multiple files from a local folder (one by one) and them paste in section in IBM Notes. The challenge is that you cannot upload file in this section of IBM Notes only Copy and Paste will work. However, since there are multiple files to be uploaded what I want to do is select one file out of them (by passing folder name and file name) copy it to clipboard, paste it in IBM Notes and then move to the second file in the same manner. Kindly help in achieving the same.

Hey @vikas_rawat, welcome to the forum! :slight_smile:

Sure, we can do that. what type of files do you want to read?

Here is a generic algo that you can follow :

Assign array_FileNames = Directory.GetFiles("Folder Path Here")
For Each fileName in array_FileNames (In properties > select TypeArgument as String)

you can use activities here to read the file content and store in a variable (serves the same purpose as the clipboard for you) and paste the content onto IBM notes.

Hope this helps. Let me know if you have any more questions on these?

1 Like

pls try below -

  • get the file list array using Directory.GetFiles(“folderpath”)
  • do a for reach for the file list array - get the file name
  • send hot key activity -> Ctrl + C (for copy )
  • send hot key activity -> Ctrl + V (for paste)
1 Like

Hi @kaderms, thanks for your response. I dont need to read the content of the file but need to copy the complete file and then paste the file itself in ibm notes.

Hi @GBK Thanks for your response, I had tried something like this but I was getting an error in that as selector was not able to get the UI element for copying. Won’t I need to select or click on the file before using Ctrl + C activity.

pls try to click the selector before copying.

There are multiples files in the folder and they may change everday, is there a way to pass dynamic value to selector?

create a dynamic selector and pass the folder name as aaname

I have the following selector used through indicator on screen, I want to select one of the file dynamically by passing the name of the file in below selector. Kindly advise how to make it dynamic.

image

create a local variable as fileName and assign the filename from the list of files.

<wnd app='explorer.exe' cls='CabinetWClass' />
<wnd aaname='Shell Folder View' cls='SHELLDLL_DefView' title='ShellView' />
<wnd aaname='Items View' cls='DirectUIHWND' />
<ctrl name='Items View' role='list' />
**<ctrl name='testFile.txt' />**
<ctrl automationid='System.ItemNameDisplay' name='Name' />

change below highlighted selector with below

> <ctrl name={{fileName}} />

1 Like

It worked. Thank you so much.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.