2015-10-19 158 views
0

我需要幫助更正下面的腳本,以自動執行非常平凡的複製/粘貼任務,我必須在接下來的幾周內對列表進行改動。將數據從Excel複製/粘貼到網站表格

我通過我們的公司網站報告了WIKI,可讓我們加載客戶端ID s爲該客戶端運行報告ID。我有一個1300個客戶端的列表,我需要在不同的幾周運行此報告,並將這些客戶端(當前在Excel工作表中)複製/粘貼到WIKI中以運行這些報告。

當前工作流程: 從Excel複製客戶端ID,選擇Chrome窗口,然後單擊文本框,粘貼,單擊選項卡,以便WIKI顯示下一個文本框以供我添加客戶端ID,返回Excel副本並重復... 1300次...

我發現following site並試圖修改他們必須工作的代碼,但我認爲自那時起詞典已經改變。我試圖尋找,但一直未能弄清楚。

repeat 2 times 
tell application "/applications/Microsoft Excel.app" to activate 
tell application "System Events" 
    tell process "Microsoft Excel" 
     keystroke "c" using command down 
    end tell 
end tell 
delay 0.3 
tell application "/Applications/Google Chrome.app" to activate 
tell application "System Events" 
    tell process "Google Chrome" 
     keystroke "v" using command down 
     keystroke tab 
    end tell 
end tell 
delay 0.3 

tell application "/applications/Microsoft Excel.app" to activate 
tell application "System Events" 
    tell process "Microsoft Excel" 
     keystroke return 
     delay 0.4 
     keystroke "c" using command down 
     delay 0.3 
    end tell 
end tell 
delay 0.3 
tell application "/applications/Google Chrome.app" to activate 
tell application "System Events" 
    tell process "Google Chrome" 
     keystroke "v" using command down 
     keystroke tab 
    end tell 
end tell 
delay 0.3 
end repeat 

,我每月運行這些報告,並完成所有的工作,讓他們在WIKI數據來獲得這些客戶端正確配置。

+0

誠實地告訴貴公司的IT人員創建一個php界面來通過HTTP上傳數據 – vadian

回答

0

的問題是,你使用的目錄應用程序時的AppleScript只需要姓名,此處

repeat 2 times 
tell application "Microsoft Excel" to activate 
tell application "System Events" 
    tell process "Microsoft Excel" 
     keystroke "c" using command down 
    end tell 
end tell 
delay 0.3 
tell application "Google Chrome" to activate 
tell application "System Events" 
    tell process "Google Chrome" 
     keystroke "v" using command down 
     keystroke tab 
    end tell 
end tell 
delay 0.3 

tell application "Microsoft Excel" to activate 
tell application "System Events" 
    tell process "Microsoft Excel" 
     keystroke return 
     delay 0.4 
     keystroke "c" using command down 
     delay 0.3 
    end tell 
end tell 
delay 0.3 
tell application "Google Chrome" to activate 
tell application "System Events" 
    tell process "Google Chrome" 
     keystroke "v" using command down 
     keystroke tab 
    end tell 
end tell 
delay 0.3 
end repeat 

希望這有助於!

相關問題