您可以使用javascript(jxa)编写文件夹操作吗? [英] Can you write folder actions with javascript (jxa)?

查看:73
本文介绍了您可以使用javascript(jxa)编写文件夹操作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找AppleScript的直接翻译

I am looking for a direct translation of AppleScript's

on adding folder items to this_folder

但是我似乎在任何地方都找不到它,无论是术语的使用还是关键字this_folder本身.

but I can't seem to find it anywhere, neither the usage of the terms or the keyword this_folder itself.

推荐答案

使用Automator,我可以构建一个Folder Action工作流以仅使用JavaScript来显示移至文件夹的文件的路径:

Using Automator I could build a Folder Action workflow to display the path of a file moved to a folder using only JavaScript:

function run(input, parameters) {
   var app = Application.currentApplication();
   app.includeStandardAdditions = true;
   var text = "FileName = " + input[0];
   var options = { };
   app.displayAlert(text, options);

   return input;
}

我希望能对您有所帮助.

I hope that could help.

这篇关于您可以使用javascript(jxa)编写文件夹操作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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