在applescript中,我使用以下代码将剪贴板设置为一个列表(数组):set the clipboard to {"4", "4", "5"}
是否可以将剪贴板中的列表项分配给bash数组?在applescript中,将列表项(从剪贴板上)分配给变量的代码如下所示:set theList to list of (the clipboard)。这段代码的bash等效值是什么?
谢谢!
因此,我想在我的AppleScript中的shell中使用一个AppleScript命令。我想在我的整个磁盘中搜索特定的文件类型,所以我做了如下操作:
set theItems to do shell script "find / -name '*.mp3'" with administrator privileges
set theItems to paragraphs of theItems
repeat with theFile in theItems
--some code that process every file here
end rep
我构建了一个小部件,它从Safari中最前面的窗口获取URL,然后允许您使用tr.im API缩短它。就像..。
我想使这更灵活,所以我正在研究如何从其他浏览器获取一个URL。下面是在Safari中工作的AppleScript:
tell application "Safari"
return URL of front document as string
end tell
在之后,我确定以下内容可能适用于火狐(尽管有一个人告诉我,它对他不起作用,可能与某个扩展有冲突?):
tell application "Firefox"
set myFir
是否有一个客观的c版本的文本分隔符?
下面是applescript代码:
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to "Jarvis>"
set charliePlainOutput to (what ever needs to be parsed)
set charlieUnmoddedOutput to last text item of charliePlainOutput
set charlieOutput
有没有办法在R中运行applescript?
我在一个中找到了这个引用
From release 1.3.1 R has partial support for AppleScripts. This means two things: you can run applescripts from inside R using the command applescript() (see the corresponding help)
但在我当前的R版本中
R version 3.4.1 (2017-06-30) Platform: x86_64-apple-darwin15.6.0 (64-bi
所以我正在开发我的小Mac应用程序,我想用它来控制Adium。AppleScript非常酷:
tell application "Adium"
go away with message "Zoned in for Maths."
end tell
(如果你想知道这应该是什么。为了真正开始学习,我需要创建应用程序来改变我的IM状态,当然.)
我在脚本编辑器中尝试过,它成功了,而且我确信从Cocoa应用程序调用AppleScript将是微不足道的。
但。
AppleScript是唯一的路吗?我不介意使用AppleScript,但它看起来像为noobs编程。
我需要从我的代码中运行AppleScript以获得LoginItems名称。我可以通过Xcode项目来完成它。但是当我对Xamarin做同样的事情时,它就失败了。
我在Xamarin项目中少了什么?任何帮助,以获得登录项目,将不胜感激。
Xcode项目代码:
NSString *script = @"tell application \"System Events\" to get the path of every login item";
NSAppleScript *appleScript = [[NSAppleScript alloc] initWit
我使用这段代码将iTunes中的每个选定轨道添加到AppleScript Obj-C中的列表中:
tell application "iTunes"
set these_titles to {}
if selection is not {} then
set mySelection to selection
repeat with aTrack in mySelection
if class of aTrack is file track then
我遇到了applescript的问题,每当我打开applescript文件(无论是在AppleScript编辑器中还是在Automator中),它都会自动打开tell语句/块中提到的任何程序。这些tell块中的大多数只能通过条件来访问,我想找到一种方法来停止applescript打开所有提到的应用程序的默认行为。
这基本上就是我正在做的事情:
if currentApplication is "Application 1" then
tell application "Application 1"
do stuff
end tell
AppleScript的列表数据类型对布尔测试说明符的支持非常有限。除了按范围选择项目(使用item关键字)外,指定类还可以:
get every «class furl» of {1, "Test", (POSIX file "/posix/path")} --> {file ":hfs:path"}
当列表项是引用时,使用contents关键字取消引用将有效:
get every «class furl» of {1, "Test", a reference to (POSIX file "/posix/pat
我正在尝试编写一个AppleScript,其中包括获取火狐中每个打开的网页的网址。
在Safari (和Chrome)中,这样做非常简单:
tell application "Safari" to return URL of every tab in every window
然而,在我看来,火狐并没有提供真正的AppleScript支持,比如获取任何选项卡或窗口的URL。当我在谷歌上搜索“火狐”和" AppleScript“时,我通常会收到火狐的bug请求,请求恢复AppleScript支持,最后一次更新是在2010年或2011年(比如和)。
那么,我认为火狐不再提供
当我使用下面的applescript (我在StackOverflow :上找到的)时,它工作得很好,只是脚本选择的单元格是一个日期,但是它不能在Applescript中正确地显示它。也许这会有所帮助:
set searchRange to range ("D1:D100")
set foundRange to find searchRange what "string" with match case
set fRow to first row index of foundRange
set myData to value of range ("B
如何使用applescript在窗口的关闭按钮中设置黑点?从中,我可以猜到类似以下内容:
tell app "CurrentApp" to set ContentsChanged to true of window 1
但它不起作用:execution error: CurrentApp got an error: Can’t make ContentsChanged of window 1 into type specifier. (-1700)
另外,如何使用applescript获取当前的应用程序?此问题与相关
对于每个列表项,我都有一个包含30+属性数据的列表,并且我正在尝试编写一个Linq查询,该查询将对列表进行操作。
我的属性为每个列表项,它们是名称、位置、年龄等等,所以如果我想筛选我的列表来选择特定的列数据,比如只有名称、位置或任何组合。
静态查询:
(from data in myList select new {DName = data.Name,myPlace= data.Place}).ToList();
因此,我希望使select部件动态化。我将存储在数组中的所有所需列信息
示例:
var arr = new [] {'Name','Age'} //
当我在MAC中看到文件夹或文件的信息时,对应于"Server“的applescript是什么?
on run
set selectedItem to (choose file with prompt "Select a file to read:" of type {"TEXT"})
tell application "Finder"
set selectedItem to (item 1 of (get selection))
set infoList to {}
co
假设我有一个文件sometext.txt。我希望txt文件的内容显示在通知中,我将在applescript中使用applescript触发该通知。
换句话说,我希望能够:
display notification "File's content" with title "Title"。
我该怎么做呢?假设sometext.txt和applescript文件位于同一个目录中。
我正在尝试将excel列的所有值存储在数组中。
set rangeDate to {value of range "A14:A100"}
repeat with date in rangeDate
if (date as string is equal to "01/01/2001") then
log "It works"
end if
end repeat
在我的Excel中,我确实在指定的列中格式化了01/01/2