开发者

How do I get properties from text document

I want to make an Applescript that gets a text from a text-document like this:

property fooBar : [insert string from text document]

tell application "Terminal"
    set currentTab to do script "e开发者_如何学运维cho" & fooBar
end tell

How do I do this?


Although I don't quite understand exactly what you're trying to do, I think you're attempting to use the contents of a text document to set the title of a Terminal tab. If that's the case, this will do so, you don't need a call to do shell script.

property foo : missing value

set fileRef to open for access (alias "Aslan:Users:chuck:Desktop:file.txt")
set foo to read fileRef
close access fileRef

tell application "Terminal" to set custom title of selected tab of window 1 to foo

Note that if that's all you want to do, the property line isn't needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜