Jump to content

Recommended Posts

Posted

Hello, after my Script worked fine 50 times today i suddenly have this problem:

After hitting F5 for executing/Go the script the script runs but does not switch / hide its own AutoIt sciTe Lite window immediately and executes everything into the other underlying target programm but instead sends the text (send commands with text) into its own windows and script. The autoit window only goes minimal/into hiding after executing the script and inserting text into the script and ruining the script with the text inserts every time. What can I do or how do i solve this ? I already have restarted all programms and the PC but the problem still exists.

Thank you in advance

Posted

 

2 hours ago, Heimii1 said:

What can I do or how do i solve this ?

First of all please post your script.

This minimal script sends e.g. the text to the SciTE editor itself, since this is the currently active window.

; ->> Send = sends simulated keystrokes to the active window
Send("Example Text")
; [] set cursor between brackets and press F5

This happens with both the Lite and the Full version of SciTE.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

MouseClick("primary", 1602, 724,3,1)   ;Location to click
Send("New text")                                      ;Send Text to layer

Send("{NUMPADENTER}")                        ;Confirm Click
sleep(1000)
MouseClick("primary", 494, 48,1,1)        ;Align the text horizontally

 

Hello, thank you very much. This is my small script to fill a text layer in Adobe Photoshop with a new text. First it clicks 3 times to activate an  Adobe text layer. Then it sends the new text, Then it confirms the new entry so that the text layer changes its content. Then after a short pause, it aligns the new text horizontally in the center of the image. 

This has worked several times: after pressing F5, it switched immediately from AutoIT to Adobe Photoshop and worked like a charm. But now after pressing F5 it clicks in the script and inserts the text in the script and ruins it and overwrites the script code in the affected script line. It seems to me that somehow the F5 command is now too slow to switch between the windows and reacts only after a few seconds when the script operation was already executed in the script itself. How can I force Autoit to immediately switch to Adobe and begin everything there and not begin to work in AutoIt and ruin my script ? Thank you very much.

Posted

Wow, thank you, I thought this was built in to switch and minimize at once when F5 was pressed, because it worked like that at least 60 times the last days. Can you tell me the command to switch to Adobe Photoshop CS 6 at once ? Thank you very much.

Posted

In advance : I almost never use AutoIt for automation purposes, so I am not an expert ;).

Your script does exactly what it is supposed to.

6 minutes ago, Jos said:

I don't see any function in the posted script to make it first go to Adobe.

Neither do I . What I am missing is that the focus is set on the Adobe window, see : WinActivate , WinWaitActive

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

Hello, thank you very much. Yes i am a newbie to AutoIt and this is my first script. I have already tried to use the WinActivate command with and for the Adobe Photoshop Window / Programm, but WinActivate("Adobe Photoshop") or WinActivate("Adobe") or WinActivate("Adobe Photoshop CS6") did not work and i had to solved it with Send("!{TAB}") = ALT + TAB. Do you have for me maybe a working WinActivate command for Adobe Photoshop CS6 ? Thank you very much in advance.

Posted

Hello, does someone has a link for me with the difference of the Lite and Full Version and where i can buy the full version ?  Maybe the Lite Version i have is a little bit buggy and this works properly only in the full version. It is very strange it worked 2 days without any problems with F5 and now it doesnt minimize anymore and inserts the text into the script.

Posted
48 minutes ago, Heimii1 said:

Do you have for me maybe a working WinActivate command for Adobe Photoshop CS6 ? Thank you very much in advance.

To find the handle and classname try this script (from the AutoIt Help)

#include <WinAPI.au3>

Example()

Func Example()
    ; Retrieve a list of window handles.
    Local $aList = WinList()

    ; Loop through the array displaying only visable windows with a title.
    For $i = 1 To $aList[0][0]
        If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
            ConsoleWrite("> >>> Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1] & @CRLF)
            ConsoleWrite("< >>>>>> Classname: " & _WinAPI_GetClassName($aList[$i][1]) & @CRLF)
        EndIf
    Next
EndFunc   ;==>Example

 

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted
4 minutes ago, Heimii1 said:

Hello, does someone has a link for me with the difference of the Lite and Full Version and where i can buy the full version ?  Maybe the Lite Version i have is a little bit buggy and this works properly only in the full version.

You don't have to buy the full version of SciTE, it is free  :)! Download : SciTE4AutoIt3.exe

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

  • Developers
Posted
1 minute ago, Heimii1 said:

Do you have a link for me where i can download the WinAPI.au3 ?

That comes with the standard AutoIt3 installer!

1 hour ago, Heimii1 said:

I thought this was built in to switch and minimize at once when F5 was pressed,

The full version of SciTE4Autoit3 has an directive for that but you always want to give the focus to the application that needs to receive the Send() information.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Sorry + thank you - I asked because the first time i ran it it threw an error but now it works and gives me the window name. Thank you very much.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...