Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recording problems - H.E.L.P. Please!
#1
Hi

I'm trying to record a macro for Adobe Photoshop. Here's what I want to do...

I have a graphic. I want several specific text phrases on the graphic. I want the macro to change one text phrase to another, save the graphic, then change the text phrase, save the graphic, and repeat to the end. There are about 80 different text phrases I want saved one graphic at a time.

I downloaded the trial version a while back, and got it to work with little fuss, so I eagerly bought the program. Now I can't get this to work at all. Here's what I do:

1. Open Photoshop and get my graphic ready.
2. Start a new macro, and then start record. I'm recording Keys, Mouse, and Text.
3. I enter the text, save the button. Then change the text to the next phrase and save the button. Then I do it one more time. I've stopped at three until I get it working,
4. I press the Insert button.

As best as I can remember that's what I did last time, and when I would play the macro it would save all the image and do everything like I wanted and expected.

Now, one of three things are happening.

1. It goes through the motions but doesn't change the text. So, I get three graphics but without the text change.
2. I get a "Wait timeout" error.
3. I get a "Window not found" error.

I have a pile of hair on the floor where I've been pulling it out. My wife is getting mad because I refuse to clean it up until I get this working.

What am I doing wrong or not doing that's preventing it from working like I did for me before?

Thanks, someone, anyone. Whoever you are, you'll be my hero if you can help me get this on track.

EDIT: I think I figured out that the "window not found" error was because I didn't have the same text phrase on the graphic that I started the macro with. I got it to save the first graphic, and it change the text phrase, but then it stopped without saving the graphic and gave me the wait timeout error again.
#2
Please post here your macro. In Quick Macros, copy it with menu Edit - Other Formats -> Forum. Then simply paste here.

Often after recording a macro need some editing. For example, recorded are full window names, and need to remove document name to make it work with all documents. Sometimes need to add 'wait' commands in some places, or change timeout of recorded 'wait' commands. Or add spe to change speed.
#3
In this version it saves three graphics, but the text doesn't change so all three graphics say the same thing.


Macro Button Text Change
Code:
Copy      Help
;---- Recorded 8/31/2013 10:31:28 PM ----
int w1=act(win("Adobe Photoshop CS4 Extended - button @ 100% (About, RGB/8) *" "Photoshop"))
'Cs             ;; Ctrl+S
int w2=wait(6 win("Save for Web & Devices (100%)" "PSExport_WindowClass"))
lef 630 675 w2 1 ;;push button 'Save'
int w3=wait(5 win("Save Optimized As" "#32770"))
'"about"        ;; "about"
lef 596 498 w3 1 ;;push button 'Save'
int w4=win("" "OWL.Dock")
dou 74 447 w4 1 ;;PSViewC
'"Contact"      ;; "Contact"
lef 74 447 w4 1 ;;PSViewC
'Cs             ;; Ctrl+S
int w5=wait(6 win("Save for Web & Devices (100%)" "PSExport_WindowClass"))
'Y              ;; Enter
int w6=wait(5 win("Save Optimized As" "#32770"))
'"contact"      ;; "contact"
lef 590 507 w6 1 ;;push button 'Save'
dou 71 453 w4 1 ;;PSViewC
'"Email"        ;; "Email"
lef 79 452 w4 1 ;;PSViewC
'Cs             ;; Ctrl+S
int w7=wait(6 win("Save for Web & Devices (100%)" "PSExport_WindowClass"))
'Y              ;; Enter
int w8=wait(5 win("Save Optimized As" "#32770"))
'"emaiil" BBB "il"  ;; "emaiil" Backspace Backspace Backspace "il"
lef 599 506 w8 1 ;;push button 'Save'
;----------------------------------------
#4
Here probably need to:
Remove "button @ 100% (About, RGB/8) *" or just " *".
Remove " (100%)".
If sometimes the 'Save' dialogs are shown with a longer delay, change code like "wait(6" to eg "wait(60".
If sometimes does not enter text, maybe the macro is too fast. For example, if it's a function. It should be macro, not function. In any case, try to add wait or spe.

Here is how the macro could look after editing. May also need to insert 'wait' commands in some other places.
Macro Macro2143
Code:
Copy      Help
spe 500 ;;set to wait 500 ms after keyboard and mouse commands. Default is 100 for macros, 0 for functions.

;---- Recorded 8/31/2013 10:31:28 PM ----
int w1=act(win("Adobe Photoshop CS4 Extended -" "Photoshop"))

'Cs ;; Ctrl+S
int w2=wait(30 win("Save for Web & Devices" "PSExport_WindowClass"))
lef 630 675 w2 1 ;;push button 'Save'
int w3=wait(30 win("Save Optimized As" "#32770"))
1 ;;wait 1 s
'"about" ;; "about"
lef 596 498 w3 1 ;;push button 'Save'
int w4=win("" "OWL.Dock")
dou 74 447 w4 1 ;;PSViewC
1 ;;wait 1 s
'"Contact" ;; "Contact"
lef 74 447 w4 1 ;;PSViewC

'Cs ;; Ctrl+S
int w5=wait(30 win("Save for Web & Devices" "PSExport_WindowClass"))
'Y ;; Enter
int w6=wait(30 win("Save Optimized As" "#32770"))
1
'"contact" ;; "contact"
lef 590 507 w6 1 ;;push button 'Save'
dou 71 453 w4 1 ;;PSViewC
1 ;;wait 1 s
'"Email" ;; "Email"
lef 79 452 w4 1 ;;PSViewC

'Cs ;; Ctrl+S
int w7=wait(30 win("Save for Web & Devices" "PSExport_WindowClass"))
1 ;;wait 1 s
'Y ;; Enter
int w8=wait(30 win("Save Optimized As" "#32770"))
1 ;;wait 1 s
'"emaiil" BBB "il" ;; "emaiil" Backspace Backspace Backspace "il"
lef 599 506 w8 1 ;;push button 'Save'
;----------------------------------------
#5
Thank you. I don't understand anything you said, but I copied and pasted the macro code you supplied and it worked.

There is hope!

Is there something I can do when I'm recording to make it work without me having to mess with the code? The simplicity of just hitting a record button was one of the main things that drew me to this software.

Also, as long as you're reading this, does the whole macro have to be recorded at once, or can I insert the cursor at the end and start recording again?

Thanks again.

Dennis

EDIT: I just tried picking up the recording where it left off, and that works, so you can disregard that question.

If you don't mind, I"ll replace it with a new questions. Smile

I tried a new macro, only instead of the speed set to fast, I set it to variable. It worked that way, but the playback is slower than I'd like. Was I just going to fast with it set to fast before? Would one of the other settings be better?

Thanks for all your help. You are my hero for the day!

Regards, Dennis
#6
Quote:Is there something I can do when I'm recording to make it work without me having to mess with the code?
Not much. For example, when recording, Quick Macros does not know whether you'll need full window names or partial, and records full. Then you have to edit recorded window names if need partial.

Quote:I tried a new macro, only instead of the speed set to fast, I set it to variable. It worked that way, but the playback is slower than I'd like. Was I just going to fast with it set to fast before? Would one of the other settings be better?
Try all the settings.
If macro runs too slow, in macro change the F=1.0 to eg F=0.5. Also you can edit or remove some 'wait' commands (the numbers).
Or if recorded with 'Slow' option, you can change the spe 100 to spe 50 or spe 200, etc.

Quote:Was I just going to fast with it set to fast before?
In most cases macro runs well with 'Fast' or 'Slow' option. If it doesn't, at first look for other reasons.
#7
I tried it on slow and that worked real well for me.

Just wanted to pop back in and say thank you for all your assistance.

I have a newsletter with about 10k subscribers. I'm going to find a way to tie in your program with with something I teach and give you a plug.

Best to you, Dennis
#8
Well, I had it finely tuned and working beautifully. It worked for two days in a row, making 7 sets of graphics on autopilot for me.

Then last night it stopped working, and again today it's not working.

What's it's doing now is, instead of changing the text on the button, it's changing the text label in the layers panel. It will save two buttons with the same text on the button instead of changing the text as it was; although the graphic is still being saved with the name change. Then on the third graphic it times out. The timing out isn't really the problem though, it's that it stopped changing the text on the button and started renaming the layer in the layers panel.

I have no idea why it started doing this. I hadn't changed anything from when it was working to when it quit. The only thing I did was copy the code into a text file to save as a backup. I tried pasting that back into the program but it still gives me the same glitch.

Here's the full code:

-- cut to make the thread easier to read --

Any ideas?
#9
Again maybe window name changed. For example, some applications append " *" to window name when the document is modified, and removes it when saved.
Or the macro runs too fast. Insert wait commands where you think it maybe runs too fast.
#10
I don't think that's it, Gintaras.

The macro starts running so the window name is the same, otherwise it wouldn't start.

And the wait commands won't do anything because it's not changing the text labels.

The first button should say "About" on it and get saved as "about.jpg". That saves OK but that was my starting text so it only had to save the button at the beginning of the macro. The second button should say "About Us" on it and get saved as "aboutUs.jpg". It's being save as "aboutUs.jpg" OK, but the text on the button still says "About" on it. Instead of the text on the button being changed, the macro is only changing the layer name in Photoshop's layers panel.

Changing the timing would only create 99 buttons that all say "About" on them. I already tried that and it didn't change anything.

Any other ideas, Gintaras?
#11
The macro is too big to understand what i does and where should be edited. Try to run it in debug/step mode, until you'll find where it starts to do something wrong, then you can correct code there.
#12
All right, thanks Gintaras. I'll try remaking it, only I'll break it up into a few smaller macros.

It got even weirder, too. I ran it a while ago and it selected a tool I didn't even use when I made the macro, then went into full screen mode (no menus), which I have never done. I had to Ctrl, Alt, Del to bring up the task manager to escape full screen.

Maybe it's just too big. It was a pain to make, lol.

Have a good one.
#13
Gintaras - good news!

I figured out why that macro quit working and I have it working like a champ again. Big Grin

I thought I'd come back and tell you what it was in case it might help you in a future support issue.

As someone new to macros, I thought, OK, it records what I do. If I click the text button, it records that I clicked the text button. I was thinking "button" ...I wasn't thinking in terms of x/y coordinates.

I told you I hadn't changed the script, but I had changed the icon size in Photoshop's layers panel. So when it went to the x/y position, it was clicking the the right place according to the script, but the wrong place according to the program's new icon size.

As soon as it dawned on me that it was recording x/y coordinates I changed the icon size back and BOOM - it started working right again.

Probably seems like an obvious mistake to you, but it wasn't for someone thinking in terms of buttons instead of coordinates.

Have a great day, Gintaras! Big Grin


Forum Jump:


Users browsing this thread: 1 Guest(s)