py-appscript is starting a new Finder instance

。_饼干妹妹 提交于 2019-12-25 03:43:23

问题


i have a py2app application, which runs an appscript using py-appscript. the Applescript code is this one line:

app('Finder').update(<file alias of a certain file>)

What this normally does is update a file's preview in Finder. It works most of the time, except for Leopard. In Leopard, everytime that script is executed, instead of updating the file, it starts a new instance of Finder. What am I doing wrong? The app was built on the same machine (the Leopard).


回答1:


Seeing as how py-appscript is a layer between python and the application you are scripting via Applescript, I would suggest porting the statement to pure Applescript and see if it works there. There are a lot of things that can go wrong with Applescript (and your statement alone) to begin with and it's not obvious what is the expected before with py-appscript when an error occurs.



来源:https://stackoverflow.com/questions/3425643/py-appscript-is-starting-a-new-finder-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!