Snooper界面脚本与常规版脚本互动

先编译界面脚本,内容如下,存储为 界面脚本.txt,并用snooper的界面脚本窗口打开


static   提示控件001   =   "KI"   position   =  0%  width   =  100%  height   =  1
crlf
edit   inputKI   filename   =   "inputki"   position   =  0%  width   =  100%  height   =  1
crlf
static   提示控件003   =   "KI 15位"   position   =  0%  width   =  100%  height   =  1
crlf
edit   inputKI15   filename   =   "inputki15"   position   =  0%  width   =  100%  height   =  1
crlf
static   提示控件002   =   "IMSI"   position   =  0%  width   =  100%  height   =  1
crlf
edit   inputIMSI   filename   =   "inputimsi"   position   =  0%  width   =  100%  height   =  1
crlf
static   提示控件004   =   "ICCID"   position   =  0%  width   =  100%  height   =  1
crlf
edit   inputICCID   filename   =   "inputiccid"   position   =  0%  width   =  100%  height   =  1
crlf
// 声明一个按钮,其基本属性与static相同
button   发行CDMA测试卡   =   "发行CDMA测试卡-Milenge算法"   position   =  20 %  width   =  60%  height   =  1
crlf
button   擦除测试卡cos   =   "擦除测试卡cos"   position   =  20 %  width   =  60%  height   =  1
crlf
// 格式 function 按钮名
function  发行CDMA测试卡
     // 结果控件名 = 函数名 数据
     // 函数可嵌套
     null   =   open_old_scriptwindow ( 00 )
     null   =   old_scriptwindow_openfile (   get_user_file_path ()   "被界面调用的apdu脚本.txt" )
     null   =   old_scriptwindow_set ( "inputKI" , $inputKI )
     null   =   old_scriptwindow_set ( "inputIMSI" , $inputIMSI )
     null   =   old_scriptwindow_set ( "inputKI15" , $inputKI15 )
     null   =   old_scriptwindow_set ( "inputICCID" , $inputICCID )
     null   =   old_scriptwindow_run ()
end   function





再编辑一个文件,内容为

?   "脚本的确执行了"
?   "inputKI      "   $ inputKI
?   "inputIMSI    "   $ inputIMSI
?   "inputKI15    "   $ inputKI15
?   "inputICCID   "   $ inputICCID

这完全就是常规版apdu脚本。

存储为 被界面调用的apdu脚本.txt,与前面的文件放在同一个文件夹中。

下面是运行结果,这个示例演示的主要内容有,
在界面脚本中打开常规版apdu窗口
将界面的内容写与apdu窗口交互
运行apdu窗口中的脚本并等待结束。

// open_old_scriptwindow  ( 00 )
//----- Final result ---
//
// old_scriptwindow_openfile  (  get_user_file_path  ( ) "被界面调用的apdu脚本.txt")
// C:\Users\Jenny\Desktop\界面调用脚本\
// C:\Users\Jenny\Desktop\界面调用脚本\被界面调用的apdu脚本.txt
//----- Final result ---
//
// old_scriptwindow_set  ( "inputKI" , 11223344 )
// inputKI 11223344
//----- Final result ---
//
// old_scriptwindow_set  ( "inputIMSI" , 66i89879876 )
// inputIMSI 6689879876
//----- Final result ---
//
// old_scriptwindow_set  ( "inputKI15" , 11223355 )
// inputKI15 11223355
//----- Final result ---
//
// old_scriptwindow_set  ( "inputICCID" , 543254325432 )
// inputICCID 543254325432
//----- Final result ---
//
// old_scriptwindow_run  ( )
// [-]==========================[X]
// | 脚本的确执行了
// | inputKI      11223344
// | inputIMSI    6689879876
// | inputKI15    11223355
// | inputICCID   543254325432
// [-]==========================[-]

猜你喜欢

转载自blog.csdn.net/jennyvenus/article/details/26698065