//自动更新工具默认忽略 edit.aardio,仅更新 edit-default.aardio, //只有手动删除 edit.aardio 后,在下次调用时,edit-default.aardio 才会自动改名为 edit.aardio var filepath = ...; import com; import process; import fsys.mime; import fsys.wow64; import process.cache; import fsys.lnk; if(fsys.isDir(filepath)){ import process.code; var codePath = ..process.code.path; if(io.exist(codePath)){ process.code(filepath); return; } else { process.explore(filepath) return; } } var m = fsys.mime.fromFile(filepath); if( ..string.startsWith(m,"image/",true)){ var opened; fsys.wow64.disableRedirection( function(){ var path = fsys.lnk.search("photoshop.exe"); if(path){ ..process.execute(path,{ filepath } ); opened = true; } } ) if(opened) return; try{ var psApp = com.CreateObject("Photoshop.Application"); psApp.open(filepath); opened = true; } if(opened) return; } var tpath = io.splitpath( string.lower(filepath) ); if( ..string.startsWith(m,"text/",true) || tpath.ext ==".js" || tpath.ext ==".ts" || tpath.ext ==".html" || tpath.ext ==".htm" || tpath.ext ==".css" || tpath.ext ==".py" || tpath.ext ==".txt" || tpath.ext ==".json" || tpath.ext ==".yaml" || tpath.ext ==".md" ){ import process.code; var codePath = ..process.code.path; if(io.exist(codePath)){ process.code(filepath); return; } } if(!process.execute(filepath,,"edit") ){ import fsys.openWith; fsys.openWith(filepath); }