做了点小小的修改,来防止出现设置了快捷键之后就没法输入空格的问题

功能建议 · 122 次浏览
漆黑之梦 创建于 2024-04-09 17:12

改进:

  1. 去掉了用管理员身份调用的逻辑,防止出现按一下空格就弹一下 UAC的情况
  2. 默认调用quicklook.exe,不带路径,这样有配置过环境变量的,就不用改动作本身了
  3. 如果发现没有选择任何文件,则自动补偿动作吃掉的空格,防止再q-dir里面没法给文件名中加空格

 

 

导出的动作内容

{
  "Row": 3,
  "Col": 2,
  "ActionType": 24,
  "Title": "用QuickLook预览文件",
  "Description": "在Q-Dir中不能用空格键使用QuickLook快速浏览文件,用此方法弥补。",
  "Icon": "https://files.getquicker.net/_icons/3455A311B4C7653B2A018FB6E5E91CC1BF140886.png",
  "Path": null,
  "DelayMs": 0,
  "Data": "{\"LimitSingleInstance\":false,\"SummaryExpression\":\"\",\"SubPrograms\":[],\"Variables\":[{\"Key\":\"text\",\"Type\":0,\"Desc\":\"默认的文本变量\",\"DefaultValue\":\"\",\"SaveState\":false,\"IsInput\":false,\"IsOutput\":false,\"ParamName\":null,\"InputParamInfo\":null,\"OutputParamInfo\":null,\"TableDef\":null,\"CustomType\":null,\"Group\":null},{\"Key\":\"files\",\"Type\":4,\"Desc\":\"\",\"DefaultValue\":\"{files}\",\"SaveState\":false,\"IsInput\":false,\"IsOutput\":false,\"ParamName\":\"\",\"InputParamInfo\":null,\"OutputParamInfo\":null,\"TableDef\":null,\"CustomType\":null,\"Group\":null},{\"Key\":\"context\",\"Type\":0,\"Desc\":\"\",\"DefaultValue\":\"{context}\",\"SaveState\":false,\"IsInput\":false,\"IsOutput\":false,\"ParamName\":\"\",\"InputParamInfo\":null,\"OutputParamInfo\":null,\"TableDef\":null,\"CustomType\":null,\"Group\":null},{\"Key\":\"isSuccess\",\"Type\":2,\"Desc\":\"\",\"DefaultValue\":\"\",\"SaveState\":false,\"IsInput\":false,\"IsOutput\":false,\"ParamName\":\"\",\"InputParamInfo\":null,\"OutputParamInfo\":null,\"TableDef\":null,\"CustomType\":null,\"Group\":\"\"}],\"Steps\":[{\"StepRunnerKey\":\"sys:getSelectedFiles\",\"InputParams\":{\"operation\":{\"VarKey\":null,\"Value\":\"getSelection\"},\"waitMs\":{\"VarKey\":null,\"Value\":\"200\"},\"sortType\":{\"VarKey\":null,\"Value\":\"Default\"},\"stopIfFail\":{\"VarKey\":null,\"Value\":\"0\"}},\"OutputParams\":{\"isSuccess\":\"isSuccess\",\"files\":\"files\",\"firstFile\":null,\"fileNames\":null,\"firstFileName\":null,\"fileCount\":null,\"errMessage\":null},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false,\"DelayMs\":0},{\"StepRunnerKey\":\"sys:simpleIf\",\"InputParams\":{\"condition\":{\"VarKey\":null,\"Value\":\"$= {isSuccess} == false\"}},\"OutputParams\":{},\"IfSteps\":[{\"StepRunnerKey\":\"sys:outputText\",\"InputParams\":{\"content\":{\"VarKey\":null,\"Value\":\" \"},\"method\":{\"VarKey\":null,\"Value\":\"input\"},\"delayBetweenChar\":{\"VarKey\":null,\"Value\":\"0\"},\"appendReturn\":{\"VarKey\":null,\"Value\":\"0\"},\"stopIfFail\":{\"VarKey\":null,\"Value\":\"1\"}},\"OutputParams\":{\"isSuccess\":null,\"errMessage\":null},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false,\"DelayMs\":0},{\"StepRunnerKey\":\"sys:keyoperation\",\"InputParams\":{\"type\":{\"VarKey\":null,\"Value\":\"key_up\"},\"key\":{\"VarKey\":null,\"Value\":\"Space\"}},\"OutputParams\":{},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false,\"DelayMs\":0},{\"StepRunnerKey\":\"sys:stop\",\"InputParams\":{\"method\":{\"VarKey\":null,\"Value\":\"forcestop\"},\"isError\":{\"VarKey\":null,\"Value\":\"1\"},\"return\":{\"VarKey\":null,\"Value\":\"\"},\"showMessage\":{\"VarKey\":null,\"Value\":\"\"}},\"OutputParams\":{},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false,\"DelayMs\":0}],\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false,\"DelayMs\":0},{\"StepRunnerKey\":\"sys:each\",\"InputParams\":{\"input\":{\"VarKey\":\"files\",\"Value\":null},\"useMultiThread\":{\"VarKey\":null,\"Value\":\"0\"},\"threadDelay\":{\"VarKey\":null,\"Value\":\"5\"}},\"OutputParams\":{\"item\":\"context\",\"count\":null},\"IfSteps\":[{\"StepRunnerKey\":\"sys:formatString\",\"InputParams\":{\"formatString\":{\"VarKey\":null,\"Value\":\"\\\"{0}\\\"\"},\"p0\":{\"VarKey\":\"context\",\"Value\":null},\"p1\":{\"VarKey\":null,\"Value\":\"\"},\"p2\":{\"VarKey\":null,\"Value\":\"\"},\"p3\":{\"VarKey\":null,\"Value\":\"\"},\"p4\":{\"VarKey\":null,\"Value\":\"\"}},\"OutputParams\":{\"output\":\"context\"},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false,\"DelayMs\":0},{\"StepRunnerKey\":\"sys:run\",\"InputParams\":{\"path\":{\"VarKey\":null,\"Value\":\"QuickLook.exe\"},\"arg\":{\"VarKey\":\"context\",\"Value\":null},\"runas\":{\"VarKey\":null,\"Value\":\"0\"},\"activateWindowIfRunning\":{\"VarKey\":null,\"Value\":\"false\"},\"activateWindowHotkey\":{\"VarKey\":null,\"Value\":\"\"},\"alternativePath\":{\"VarKey\":null,\"Value\":\"\"},\"stopIfFail\":{\"VarKey\":null,\"Value\":\"1\"},\"setWorkingDir\":{\"VarKey\":null,\"Value\":\"\"},\"windowStyle\":{\"VarKey\":null,\"Value\":\"0\"},\"waitInputIdle\":{\"VarKey\":null,\"Value\":\"0\"},\"waitExit\":{\"VarKey\":null,\"Value\":\"0\"},\"username\":{\"VarKey\":null,\"Value\":\"\"},\"password\":{\"VarKey\":null,\"Value\":\"\"},\"outputEncoding\":{\"VarKey\":null,\"Value\":\"oem\"},\"envVariables\":{\"VarKey\":null,\"Value\":\"\"}},\"OutputParams\":{\"isSuccess\":null,\"pid\":null,\"mainWinHandle\":null,\"mainWinTitle\":null,\"stdout\":null,\"stdoutOnly\":null,\"stderr\":null,\"exitCode\":null,\"errMessage\":null},\"IfSteps\":null,\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false,\"DelayMs\":0}],\"ElseSteps\":null,\"Note\":\"\",\"Disabled\":false,\"Collapsed\":false,\"DelayMs\":0}]}",
  "Data2": null,
  "Data3": null,
  "Children": [],
  "Id": "d11f72ae-1e90-4d61-a97f-26d76a47f6df",
  "TemplateId": "47bdf548-2902-475d-e14b-08d94990cd91",
  "TemplateRevision": 1,
  "UseTemplate": false,
  "LastEditTimeUtc": "2024-04-09T09:05:00.2528622+08:00",
  "SharedActionId": null,
  "ShareTimeUtc": null,
  "CreateTimeUtc": "2024-04-03T06:40:33.7025039+08:00",
  "AsSubProgram": false,
  "SkipWhenStopRunningActions": false,
  "SkipCheckUpdate": false,
  "AutoUpdate": false,
  "KeepInfoWhenUpdate": false,
  "MinQuickerVersion": "",
  "ContextMenuData": "",
  "AllowScrollTrigger": false,
  "EnableEvaluateVariable": true,
  "IsTextProcessor": false,
  "IsImageProcessor": false,
  "Association": {
    "MatchProcess": null,
    "IsImageProcessor": false,
    "ReturnImageFromFirstScreenShotStep": true,
    "IsTextProcessor": false,
    "ReturnTextFromGetSelectedTextStep": true,
    "TextMatchExpression": "",
    "TextMinLength": 0,
    "TextMaxLength": 0,
    "IsHtmlProcessor": false,
    "IsFileProcessor": false,
    "FileMinCount": 0,
    "FileMaxCount": 0,
    "AllowedFileExtensions": "",
    "RequireAllFileMatchExt": false,
    "SearchBoxPlaceholder": "",
    "IsWindowProcessor": false,
    "EnableRealtimeSearch": false,
    "BrowserContextMenu": null,
    "UrlPattern": ""
  },
  "DoNotClosePanel": false,
  "UserLimitation": 0
}

回复内容
暂无回复
回复主贴