Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用iMessage和AppleScript在iTunes中扮演艺术家_Applescript_Itunes_Imessage - Fatal编程技术网

使用iMessage和AppleScript在iTunes中扮演艺术家

使用iMessage和AppleScript在iTunes中扮演艺术家,applescript,itunes,imessage,Applescript,Itunes,Imessage,所以我在“iTunes Remote Control.applescript”上游手好闲,以便iMessage将我的手机用作iTunes的遥控器 我被困在一个点上,我想用我的手机发送一条信息,比如“艺术家埃米纳姆”或我图书馆里的任何其他艺术家,并让它在iTunes中播放 这就是我现在拥有的,但我需要一个字符串变量来存储“artist”之后的部分,然后让iTunes播放特定的字符串(艺术家)名称 否则,如果消息是“最艺术的”,那么(这里我需要一些排序存储到字符串方法中) 告诉应用程序“iTunes

所以我在“iTunes Remote Control.applescript”上游手好闲,以便iMessage将我的手机用作iTunes的遥控器

我被困在一个点上,我想用我的手机发送一条信息,比如“艺术家埃米纳姆”或我图书馆里的任何其他艺术家,并让它在iTunes中播放

这就是我现在拥有的,但我需要一个字符串变量来存储“artist”之后的部分,然后让iTunes播放特定的字符串(艺术家)名称

否则,如果消息是“最艺术的”,那么(这里我需要一些排序存储到字符串方法中)

告诉应用程序“iTunes”
播放(艺术家为“”的库播放列表1的每首曲目)
结束语
有人知道这是否可能,如果可能,我将如何实现这一点

set x to "Artist Bryan Adams"

set y to offset of " " in x
set artist to characters (y + 1) thru -1 in x as string
艺术家被设定为“布莱恩·亚当斯”

这将播放那位艺术家的第一首曲目。所以,如果你按照艺术家的要求订购,它将播放所有艺术家的歌曲。这不是一个优雅的解决方案,但它确实很重要

set x to "Artist Bryan Adams"

set y to offset of " " in x
set artist to characters (y + 1) thru -1 in x as string
tell application "iTunes"
    set mySongs to every track of library playlist 1 whose artist is artist
    play item 1 of mySongs
end tell