Jump to content

Autoıt'de Office Programını Çalıştırmak


MasterTR
 Share

Recommended Posts

[code]Run("winword")

WinWait("[CLASS:OpusApp]")

WinActivate("[CLASS:OpusApp]")

ControlSend("[CLASS:OpusApp]", "", "_WwG1", "Merhaba Master TR")[/code]

[b]Bunu çalıştırda winword yaziyorum office çalışıyor Run komutunun içine yazıp çağırdığımda çalışmıyor.[/b] Edited by MasterTR
Link to comment
Share on other sites

[codebox]#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Users\MERT\Desktop\Form1.kxf

$Form1 = GUICreate("Form1", 343, 274, 319, 494)

$MenuItem1 = GUICtrlCreateMenu("Dosya")

$MenuItem3 = GUICtrlCreateMenuItem("Çıkış", $MenuItem1)

$MenuItem2 = GUICtrlCreateMenu("MasterTR")

$Button1 = GUICtrlCreateButton("Button1", 104, 200, 115, 41)

$Input1 = GUICtrlCreateInput("Input1", 112, 48, 105, 21)

$Input2 = GUICtrlCreateInput("Input2", 112, 88, 105, 21)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###



While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

; buraya yazacağın her şey butonun görevini belirtir.

MsgBox(0, "Deneme", "Merhabe Dünya") ;gibi
EndSwitch

WEnd[/codebox]

Case $form1 yanlış kullanılmış öyle bi kullanım yapamazsın bu arada.

Edited by KintaRo
codebox
Link to comment
Share on other sites

[b]hocam kullanımı program yaptı ben değil,Autoıt programını açtım tools menüsünden Forum Codda(Form Desiner) seçtim deneme amaçlı birşeyler ekledim ve F9 basarak codelarını alıp AutoIt Edit açarak içine yapıştırdım Derledim sonuç bu yanlış nasıl yapılmış bilmek isterim ki tekrar karşılaşmayayım,.[/b]

[b]Anladım nasıl yapacağımı peki burda neden notepad çalışmadı.Görev verdim olmadı[/b]

Edited by MasterTR
Link to comment
Share on other sites

Dediğin şekilde butona görev atadım Mesaj uyarısı çalışıyor WinWaitActive metodunu onunla kullanmaya çalıştığımda mesaj kutusuda devre dışı kaldı,çözemedim nerde hata yaptığımı metin belgesi açtırım onu yazdıracaktım.
[codebox]#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Users\MERT\Desktop\Form1.kxf

$Form1 = GUICreate("Form1", 343, 274, 319, 494)

$MenuItem1 = GUICtrlCreateMenu("Dosya")

$MenuItem3 = GUICtrlCreateMenuItem("Çıkış", $MenuItem1)

$MenuItem2 = GUICtrlCreateMenu("MasterTR")

$Button1 = GUICtrlCreateButton("Button1", 104, 200, 115, 41)




$Input1 = GUICtrlCreateInput("Input1", 112, 48, 105, 21)

$Input2 = GUICtrlCreateInput("Input2", 112, 88, 105, 21)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###



While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit



Case $Form1

Case $Button1

WinWaitActive("Untitled- Notepad", "Merhaba MasterTR ?")
MsgBox(0, "My First Script!", "Hello World!")

Case $Input2

EndSwitch

WEnd
[/codebox]

Edited by KintaRo
Link to comment
Share on other sites

[codebox]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\MERT\Desktop\Form1.kxf
$Form1 = GUICreate("Form1", 343, 274, 319, 494)
$MenuItem1 = GUICtrlCreateMenu("Dosya")
$MenuItem3 = GUICtrlCreateMenuItem("Çıkış", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("MasterTR")
$Button1 = GUICtrlCreateButton("Button1", 104, 200, 115, 41)
$Input1 = GUICtrlCreateInput("Input1", 112, 48, 105, 21)
$Input2 = GUICtrlCreateInput("Input2", 112, 88, 105, 21)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Form1
Case $Button1
Run("notepad")
WinWait("[CLASS:Notepad]")
WinActivate("[CLASS:Notepad]")
ControlSend("[CLASS:Notepad]", "", "Edit1", "Merhaba Master TR")

Case $Input2
EndSwitch

WEnd[/codebox]

Link to comment
Share on other sites

[quote name='KintaRo' date='17 August 2011 - 11:27 ' timestamp='1313569674' post='1064635']
[warning][b]arkadaşlar uzun kodlarınızı codebox tagı içinde verelim, bu konudakileri ben düzelttim.[/b][/warning]
[/quote]


blue_life üstadın dediği gibi ya class bilgisini alırsın ya da açılan notepad penceresinin üzerinde yazan başlığa (title) göre işlem yaparsın. Başlığa göre yapacak olursan komut şu şekilde olmalı:
[code]
WinWaitActive("Notepad")
[/code]

Fakat diğer yöntem daha garantidir. Yani notepad aktif oluncaya kadar bekletmeye yarayan bir komut.

Link to comment
Share on other sites

Evet çok iyi anladım progmın class bilgisini öğrenmek için Info kullanacağız en güzel özelliği ise ınfo metin belgesinin içerigini Visible göstermesi sevdim bunu biraz tekrar ediyim :)
[color="#0000FF"][b]KintaRo[/b][/color] [b]Üstat bundan sonra dikkat edeceğim uyarın için teşekkürler.[/b]

[b]Biraz Çalışma Yapayım.[/b]

Office Sorunu güncellendi postun başında.

Edited by blackman12
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...