--可根据文件扩展名,查找关联程序,以打开文件的行为库,COPY即可用
--请浏览:
http://www.xcoming.com--Open file with exe
property pFileName
property pFilePath
property pEvent
on mouseup me
if pEvent="mouseup" then fdoopen
end
on mousedown me
if pEvent="mousedown" then fdoopen
end
on mouseenter me
if pEvent="mouseenter" then fdoopen
end
on mouseleave me
if pEvent="mouseleave" then fdoopen
end
on fdoopen me
baRegister( "DiABLO [ORiON]" , 3157792 )
if pFilePath="windows path" then
pFilePath=baSysFolder( "windows" ) --读取系统目录
else if pFilePath="the moviepath" then
pFilePath=the moviepath
end if
if baFileExists(pFilePath & pFileName) then
tmp=baOpenFile( pFilePath & pFileName , "Normal" )
if tmp=31 then alert("没有找到关联文件!")
end if
end
on getpropertydescriptionlist me
act=["mousedown","mouseup","mouseenter","mouseleave"]
plist=[:]
plist.addprop (#pFileName,[#comment:"OpenFileName(include expand name):",#format:#string,#default:""])
plist.addprop (#pFilePath,[#comment:"OpenFilePath",#format:#string,#default:"windows path",#range:["windows path","the moviepath"]])
plist.addprop (#pEvent,[#comment:"触发事件:",#format:#string,#default:"mousedown",#range:act])
return plist
end