Hi,
I am new to this program and I was trying to write a macro to automate the pasting of numbers from Excell to a picture in Adobe photoshop. It seemed to work initially but then the command 'Cv seems not to work properly. In Adobe you need to activate a particulaer window and then highlight the text to be able to paste. I did it and seemed to work, but when I try to repeat the operation and paste another number macro 2 does not activate properly the feature in Adobe and the pasting does not happen. Any suggestions?
Thanks Luisa
Thank you for your reply. I like this program very much and was a bit upset with its behavior in this sort of easy case. Find attached the text of the macro I wrote. There are some commands that help me open and close the files I need and they are connected to my directories but, I am sure you can figure that out.
As I told you in another e-mail I sent to your support, I ran the script for 100 files to be created and I think 50% of the time it was pasting the other one not.
Looking forward to hearing soon from you,
Cheers Luisa
find below the text of the macro and function which is called inside.
Cheers Luisa
--------------------------------
Macro:
int i=1
int N=100
str s
str file_name
str file_name2
------- Clean directories -----------------
del- "C:\WINDOWS\Desktop\overseas 100\files to convert\*.*"
del- "C:\WINDOWS\Desktop\overseas 100\files converted bmp\*.*"
---------- copy files in files to convert and open in adobe---------
Try to insert this at the beginning of the macro, and at the beginning of the function too. This command disables clipboard restoring.
Normally, outp and other clipboard commands restore clipboard text. To give application time to retrieve text from the clipboard, restoring occurs with about 1 s delay. This can conflict with key Cc and key Cv.
What you think is the reason why pasting does not work?:
1. When Photoshop window is activated, the area where the macro must paste does not receive focus. Even when you insert a delay before 'Cv. In this case, pasting manually also would not work until you click it.
2. The clipboard is empty. To test, use this: out _s.getclip
3. ...
[/code]
Hi,
I am back. I was busy working. I tried what you suggested and somehow it did work better, but not totally perfect. Over 20 files I created the number was correctly pasted in the adobe file 17 times, surely better than before. I also ran the macro with out _s.getclip as you suggested and it seems like the right number is in the clippord but for some reason it does not paste it in a random fashion I would say.
Concerning your observation in point 1, when the macro runs it highlights the area where I want to paste the number as it happens when I do it manually, but sometimes the number is not pasted.
Any further suggestions?
Cheers Luisa
Hi,
Thank you very much for your suggestions. The first one was the one that worked. I created my 100 files and the pasting happened with no fail.
I really like QM it is a great tool and fun to work with.
Cheers Luisa