仅从 AppleScript 中的别名列表中获取常规文件
如果我有别名列表,如何删除非常规文件的别名或创建仅包含常规文件的新列表。主要问题是如何确定别名是否是常规文件。我尝试过这个,但它很老套,而且并不总是有效(就像使用 .app 文件一样)。
if (theFile as string) does not end with ":" then ...
我该怎么做?
If I have a list of aliases, how can I either remove the ones that are not regular files or create a new list with only regular files. The main question is how to determine if an alias is a regular file. I tried this, but it's hacky and it doesn't always work (like with .app files).
if (theFile as string) does not end with ":" then ...
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用文件的“kind”属性来确定它是什么......
You can use the "kind" property of a file to determine what it is...
这看起来有点hacky,但这似乎工作得很好:
我最初尝试测试最后的“:”路径,但它对于捆绑应用程序和类似的文件(实际上是文件夹)来说是错误的。
It seems kind of hacky, but this seems to work well:
I initially tried testing the path for a ":" at the end, but it breaks for bundled applications and similar files-which-are-really-folders.