Hi everybody,
I have a small question. I want to add a file to my clipboard.
But if the description is correct it is only possible to insert a Text.
Is there any another way?
I'm using v14.0.12
Best regards
HolyAbsolut
Clipboard & File
Moderators: Dorian (MJT support), JRL
Use the CopyFile or MoveFile commands.
OR with variables:
Or with variables:
Code: Select all
CopyFile>c:\temp\myfile.txt,c:\my documents\myfile.old
Code: Select all
Let>filename=c:\temp\myfile.txt
Let>newfilename=c:\temp\myfile.new
CopyFile>filename,newfilename
Code: Select all
MoveFile>c:\temp\myfile.txt,c:\temp\myfile.bak
Code: Select all
Let>filename=c:\temp\myfile.txt
Let>newfilename=c:\temp\myfile.bak
MoveFile>filename,newfilename
-
- Newbie
- Posts: 17
- Joined: Wed Sep 21, 2011 10:28 am
Sounds like the program you want interact with has a file open/import feature. There most likely is a way to copy files to the program but I can't tell you how since I know nothing about it.
Here are a couple examples how you can interact with MS Paint.
Here are a couple examples how you can interact with MS Paint.
Code: Select all
//Directory to image
Let>FileToAdd=C:\MyImg.bmp
RunProgram>mspaint.exe
WaitWindowOpen>Untitled - Paint
Wait>1
SetFocus>Untitled - Paint
Wait>1
//Send Control+o to open the Open window
CapsOff
Press Ctrl
Send>o
Release Ctrl
WaitWindowOpen>Open
Wait>1
GetWindowHandle>Open,hWndParent
FindObject>hWndParent,Edit,,1,hWnd,X1,Y1,X2,Y2,result
ObjectSendKeys>hWnd,%FileToAdd%,VK13
Code: Select all
//Directory to image
Let>FileToAdd=C:\MyImg.bmp
RunProgram>mspaint.exe "%FileToAdd%"
-
- Newbie
- Posts: 17
- Joined: Wed Sep 21, 2011 10:28 am
Hi
thanks for your continues support. The program I'm talking about will not support such a feature as handing over parameters. It even does not support CTRL-V I only can right click and press "Add File from Clipboard"
So if there is no way to take it in copy I will try it on an other way
Best regards
HolyAbsolut
thanks for your continues support. The program I'm talking about will not support such a feature as handing over parameters. It even does not support CTRL-V I only can right click and press "Add File from Clipboard"
So if there is no way to take it in copy I will try it on an other way
Best regards
HolyAbsolut
- CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
You should be able to browse to the file in explorer have macroscheduler copy the file to clipboard, switch to the application, right click and add file from clipboard,
If you can give us the program name, maybe a screenshot Iam sure we can work something out.
Edit: Attached a quick mock up. Was written very quickly on a Windows 7 machine, may require some tweaking for your needs.
If you can give us the program name, maybe a screenshot Iam sure we can work something out.
Edit: Attached a quick mock up. Was written very quickly on a Windows 7 machine, may require some tweaking for your needs.
Code: Select all
//http://www.mjtnet.com/usergroup/clipboard-file-t7852.html
Let>INPUT_BROWSE=1
Input>vFileLocation,Please Select File To Save To Clipboard,
If>%vFileLocation%=
MDL>No File Selected / Cancelled Now Exiting
Goto>Exit
EndIF
ExtractFilePath>%vFileLocation%,vFilePath
ExtractFileName>%vFileLocation%,vFileName
ExecuteFile>%vFilePath%
Separate>%vFilePath%,\,vFilePathArray
Let>vEndFolder=vFilePathArray_%vFilePathArray_Count%
Let>WW_TIMEOUT=30
WaitWindowOpen>%vEndFolder%
If>WW_RESULT=FALSE
MDL>Window Timed Out Closing Application
Goto>Exit
EndIf
Wait>5
SendText>%vFileName%
Press Ctrl
Wait>0.05
SendText>c
Wait>0.05
Release Ctrl
Wait>0.05
CloseWindow>%vEndFolder%
MDL>File Copied To Users Clipboard
Label>Exit
Exit>0
FIREFIGHTER
- CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
I also think this helps explain the issues around something like copying a file to clipboard.
You could look at DROPTOCLIP http://jpsoft.com/forums/threads/copyin ... -tcc.4463/
But I don't have the time for that at the moment. As when you copy a file you are copying more that just the path, there are like 12 different strings / handles so the application receiving the file knows what to do.
Basically this seems to be a common questions and no real answer.Question: What is the command line equivalent to pressing CTRL+C over a file in the file manager so that the file (not the filename) is copied to the clipboard?
Answer: When you press Ctrl-C over a file in the file manager, the file's contents IS NOT copied to the clipboard.
You could look at DROPTOCLIP http://jpsoft.com/forums/threads/copyin ... -tcc.4463/
But I don't have the time for that at the moment. As when you copy a file you are copying more that just the path, there are like 12 different strings / handles so the application receiving the file knows what to do.
FIREFIGHTER