如果我運行: tell application "Maps"
set miniaturized of windows to false
end tell
...這工作正常 然而,當我運行: set applicationName to "Maps"
tell application applicationName
set miniaturized of windows
我遇到了一些問題腳本(我認爲會)是我正在處理的一個非常簡單的部分。基本上,我想告訴Finder打開一個特定應用程序的文件。很簡單,對吧?從我讀過,我應該能夠使用: tell application "Finder"
open "the_file" using "the_application"
end tell
麻煩的是查找似乎有一個時間找到應用赫克。當我使用下面的代碼:是 set
我想打開一個文件,並使用f.seek()和f.tell()閱讀每一行: 的test.txt: abc
def
ghi
jkl
我的代碼是: f = open('test.txt', 'r')
last_pos = f.tell() # get to know the current position in the file
last_pos = last_pos + 1
f.see
正常工作,這個腳本是打開的微軟應用程序,然後3秒 tell application "Finder"
set myFolder to ((startup disk as text) & "Applications:Microsoft Office 2011") as alias
set myFiles to (every item of myFolder) as alias list
ope
我每次運行這個腳本時都會收到這個錯誤:System Events出錯:「Test123」不理解通知消息。 代碼: --more code...
tell application "System Events"
if some_system_events_property then
my notify of "Test123" thru "Test"
end if
我想通過csv文件閱讀時,我正在查找的百分比。我知道如何使用tell()和文件對象來做到這一點,但是當我使用csv.reader讀取該文件對象時,然後對我的reader對象中的行執行for循環,tell()函數總是返回它在文件的末尾,無論我在循環中的哪個位置。我怎樣才能找到我的位置? 當前代碼: with open(FILE_PERSON, 'rb') as csvfile:
spamr