change an alias target python

我的未来我决定 提交于 2019-12-21 21:08:16

问题


I would like to change the target of an alias using python. do I have to download some external library to do this. I played around with aliases a bit and can't figure out any way to edit them without user input.

I'm using mac, python 2.6


回答1:


As far as I can tell it should be possible using PyObjC to get at the Mac's Foundation library. I think NSURLBookmarkResolutionWithoutUI is what you are looking for.




回答2:


PyObjC was a good suggestion. I couldn't find a solution anywhere, but after asking an equivalent question, finally managed to create one. See my answer to my own question: how to read, change, and write macOS file alias from python



来源:https://stackoverflow.com/questions/8360725/change-an-alias-target-python

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