|
试了一个程序:打开记事本程序,记事本中输入的内容和保存的文件名是传递过来的变量,变量赋值在头文件中。两个脚本,一个头文件
脚本notepadtest:
'$include:"notepadheader"
declare sub newnotepad basiclib "notepadstart"(notepadinput as string,notepadname as string)
Sub Main
Dim Result As Integer
dim notepadinput as string
dim notepadname as string
'Initially Recorded: 2005-04-18 20:45:44
'Script Name: notepadtest
call newnotepad(notepadinput,notepadname)
End Sub
脚本 notepadstart:
'$include:"notepadheader"
declare sub newnotepad(notepadinput as string,notepadname as string)
Sub newnotepad(notepadinput as string,notepadname as string)
Dim Result As Integer
'Initially Recorded: 2005-04-18 20:46:05
'Script Name: notepadstart
StartApplication "F:\NOTEPAD.EXE"
Window SetContext, "Caption=未定标题 - 记事本", ""
InputKeys notepadinput
Window SetContext, "Caption=未定标题 - 记事本", ""
MenuSelect "文件(F)->另存为(A)..."
Window SetContext, "Caption=另存为", ""
ComboEditBox Left_Drag, "ObjectIndex=3", "Coords=55,4,-64,13"
InputKeys notepadname
PushButton Click, "Text=保存(S)"
end if
End Sub
头文件notepadheader:
sub notepadheader
dim notepadinput as string
dim notepadname as string
notepadinput = "12345"
notepadname = "01"
end sub
但是变量总是引用不过来,不知道为什么。哪位能给指点一下谢谢了 |
|