AHK代码以找到驻留文件夹并突出显示活动文件 [英] AHK code to locate the residing folder and highlight the active file

查看:190
本文介绍了AHK代码以找到驻留文件夹并突出显示活动文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常需要快速找到打开的活动文件的文件夹位置,并在使用不同的软件应用程序时突出显示或选择活动文件.快速查找在同一文件夹中查找相关文件所需的驻留文件夹,重命名已打开的文件或驻留文件夹,或将文件移动到其他相关文件夹.当前选项要求浏览文件夹的负载,以查找和定位特定文件夹所在的位置,该文​​件夹被一堆类似的其他文件掩埋(类似于在大海捞针中查找针头). Microsoft Office套件具有名为文档位置"的内置功能,可以将其添加到快速访问工具栏中.但是它只允许查看文件夹位置或完整路径,而没有可用的单击命令或键(AFAIK)方便地跳转到该定位文件夹并突出显示/标识已打开的文件,以便可以进行进一步的操作(例如重命名,移动)在该特定文件/文件夹上.对于其他软件应用程序(本机程序具有获取完整路径的选项,但无法跳转到特定文件/文件夹的选项)的情况也是如此.将Microsoft Office套件应用程序(例如word)之一作为测试用例,我可以想象的过程如下:

It’s often requires to quick locate the folder location of open active file and highlight or select the active file while working on different software applications. Quick locating the residing folder needed for finding related files in same folder, rename of the opened files or residing folder or move the file to different related folder. Current options require navigating through the loads of folders to find and locate the specific folder where it’s buried with bunch of similar other files (similar to find needle in a haystack). Microsoft Office suite has built-in feature named "document location" which can be added to quick access toolbar. But it only allow to see the folder location or full path but no single click command or key available (AFAIK) to conveniently jump to that locating folder and highlight/identified the opened file so that further operation (e.g. rename, move) could be done on that specific file/folder. This is also the case for other software applications where native program have options to get full path but no way to jump to the specific file/folder. Considering one of Microsoft Office suites application (e.g. word) as test cases the processes I could imagine as follows;

  • 1获取当前打开的Word文档的完整路径(D:\ Folder \ Subfolder \ Mywordfile.docx)
  • 2关闭文件
  • 3资源管理器命令,以选择并突出显示具有完整路径的文件夹中的文件(过程1)
  • 根据需要手动操作文件/文件夹,然后双击以返回文件操作应用程序(例如word).

在我对上述任务的执行情况的评估中,以下是可能性

In my assessment for Implementation of above tasks following are possibilities

  • 任务1 Microsoft Word具有一个称为文档位置"的内置函数,用于获取打开的文档的完整路径以及它当前可能在剪贴板中复制文件路径.
  • 任务2关闭文件(Ctrl + W或Ctrl + F4)
  • 资源管理器命令的任务3 AHK代码,以选择给定完整路径的文件(任务1中可用)

我在任务3中遇到困难,我尝试了其中的每一个,但到目前为止还没有运气

I am facing difficulties in Task 3 and I tried each of these but so far no luck

Clipboard := "fullpath" ; Full path (D:\Folder\Subfolder\Mywordfile.docx ) copied from Word 

Run explorer /e, "Clipboard" 

Run %COMSPEC% /c explorer.exe /select`, "%clipboard%"

到目前为止,在资源管理器命令上方,仅将我带到我的documents文件夹,而不是在特定的文件夹位置(任务1中的路径).我很好奇知道什么是正确的资源管理器代码,可以为剪贴板中给定的完整路径选择文件.感谢支持AHK代码或执行此任务的更好方法.预先感谢.

So far above explorer command only take me to my documents folder not in the specific folder location (path in Task 1). I am curious know what would be the right explorer code to select the file for a given full path in clipboard. Appreciate for supporting AHK code or better way to do this task. Thank in advance.

推荐答案

我不清楚您的示例代码为何不起作用.我怀疑是因为多余的字符.

I'm not clear on why your sample code doesn't work. I suspect it's because of the extra characters.

运行此命令后,将打开Windows资源管理器并选择所需的文件(如果存在).

After running this command Windows Explorer will be open and have the desired file selected (if it exists).

FullPathFilename := "e:\temp\test.csv"
Explorer := "explorer /select," . FullPathFilename
Run, %Explorer%

这篇关于AHK代码以找到驻留文件夹并突出显示活动文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆