首页 \ 问答 \ Applescript播放曲目spotify(Applescript play track spotify)

Applescript播放曲目spotify(Applescript play track spotify)

我想通过运行一个applescript来播放曲目。 我无法找出播放轨迹的方法。

我正在这样做

tell application "Spotify"
    play track "One Thing" in context spotify:track:5Up9Lj7QWudEfMc0ve5qWW
end tell

这显然不起作用。 我不知道如何处理上下文部分。 什么是上下文?


I want to play a track by running an applescript. I'm having trouble figuring out the play track method.

I'm doing this

tell application "Spotify"
    play track "One Thing" in context spotify:track:5Up9Lj7QWudEfMc0ve5qWW
end tell

that obviously doesn't work. I don't know what to do with the context part. What is a context?


原文:https://stackoverflow.com/questions/11607618
更新时间:2023-05-11 08:05

最满意答案

事实证明,视图已在SurfaceCreated中删除,您无法在4.2中删除该视图,并且根本不应该执行此操作。 (按照罗曼的说法:“你做得不好!”)


It turns out, the view was removed onSurfaceCreated, you cannot remove the view anymore in 4.2 and should not do it at all. (as per romain: "You are doing something bad!")

相关问答

更多
  • 首先例如camera2 api android有一个开源的谷歌示例代码。 https://github.com/googlesamples/android-Camera2Basic 第二部分要绘制矩形的部分(触摸以进行对焦)请按照以下步骤操作 - 创建一个扩展到SurfaceView的自定义类。 调用此自定义类中的onTouchListener方法来检测手指坐标并使用android中的paint类绘制矩形。 - 在显示来自camera2的预览的TextureView上添加此自定义类。 将自定义视图变为透明。 ...
  • 您的服务器没有崩溃。 当客户端连接关闭/丢失时, EIdSocketError是TIdTCPServer遇到的完全正常的异常。 这是正常的行为。 TIdTCPserver将在内部为您处理它并在异常逃逸到服务器时关闭套接字(您应该允许它执行 - 如果您自己捕获它,请在完成后重新提升它)。 您完全看到异常的唯一原因是调试器会在您的应用看到它之前报告它。 只需按F9键让调试器将其传递给应用程序进行正常处理,或者配置调试器以忽略基于Indy EIdException的异常。 Your server is not c ...
  • 你的问题是 dirArray = [fileManager contentsOfDirectoryAtPath:path error:nil]; 将有dirArray指向一个自动释放对象。 因此,当您稍后访问它时,它将被释放。 要么保留它。 dirArray = [[fileManager contentsOfDirectoryAtPath:path error:nil] retain]; 或者更好,宣布它是一个财产,并做 self.dirArray = [fileManager contentsOfD ...
  • 你应该解决这个问题。 由于您的崩溃日志中包含该错误消息,因此您知道哪种方法可以引发问题,因此即使问题本身不一致和/或以各种方式出现问题,您仍然可以很好地开始修复问题。 但偶尔的崩溃可能看起来不会对您造成太大的不便,但这是一星评价和不满意客户的最快捷方式。 我怀疑你会很快后悔分发一个已知的,易于复制的崩溃的应用程序。 但是,一些意见: 听起来你的后台更新过程正在改变主线程使用的模型对象。 如果可能,我建议小心不要在后台线程中更改任何模型对象,而是填充局部变量,当您准备好相应地更新UI时,调度模型更新和UI刷新 ...
  • 事实证明,视图已在SurfaceCreated中删除,您无法在4.2中删除该视图,并且根本不应该执行此操作。 (按照罗曼的说法:“你做得不好!”) It turns out, the view was removed onSurfaceCreated, you cannot remove the view anymore in 4.2 and should not do it at all. (as per romain: "You are doing something bad!")
  • glVertexAttribPointer(0, 4 * 4, GL_FLOAT, GL_FALSE, 4 * 4 * sizeof(GLfloat), NULL); 您的崩溃是一个简单的复制粘贴错误的结果。 这里使用属性0,这意味着您从未为属性1调用glVertexAttribPointer 。因此,它使用默认属性状态,从而导致崩溃。 但是,我强烈怀疑您正在尝试将4x4矩阵作为单个属性传递。 那不行; 如果您尝试将属性的大小设置为大于4,则OpenGL将为您提供GL_INVALID_VALUE错误 。 ...
  • 当TextureView失去可见性时(或者因为屏幕旋转,其他Activity出现在前面或者您按下Home按钮),它会使其SurfaceTexture.OnFrameAvailableListener (在GrepCode上 ) 失效 。 它看起来像是在发生这种情况时, Canvas实例在C ++代码本身执行drawX()方法时,应用程序将崩溃,因为在某些原因下,包含该画布的内存在方法完成之前被清除。 但是,由于Canvas.drawX()方法使用Android本机C ++代码,因此C ++不会抛出NullP ...
  • 如果单元格从tableview成功出列,则忽略将指针bottomLabel设置为任何特定值,然后隐式取消引用它。 如果你真的不希望它在单元格出列时指向任何东西,那么将它初始化为指向nil: UITextView *bottomLabel = nil; 在Objective-C中向nil发送消息总是安全的。 你已经注释掉了这条线: //bottomLabel = (UILabel *)[cell viewWithTag:BOTTOM_LABEL_TAG]; 如果不知道你的程序的更广泛的上下文,我想这也可能 ...
  • Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application 看起来上下文很糟糕,有时getApplicationContext()返回奇怪的结果...尝试更改此内容: new AlertDialog.Builder(getApplicationContext()); 至: new AlertDialog.Builder(MainA ...
  • 在像ImageView这样的简单视图中,在许多实现中使用了canvas。 而不是在onDraw()方法最终使用Matrix的视图中的画布。 例: 在ImageView上: canvas.translate(x, y); canvas.scale(mScaleFactor, mScaleFactor); 在TextureView上: matrix.postTranslate(x, y); matrix.postScale(mScaleFactor, mScaleFactor); github中的示 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)