2011-05-14 31 views
0

我有一個以.txt格式(每行一個memberID)的幾百個成員的列表,我需要使用Automator將它們添加到Web應用程序。使用Automator/Applescript輸入數據?

所以txt的是一樣的東西:

30335842 
30335843 
30335844 
... 

,我需要插入此網頁上,但我想這就是最簡單的部分,因爲我可以創建使用Automator動作。

只是不確定如何從文本文件中獲取每次與自動工作流程一起使用的新ID。

非常感謝您的幫助。

回答

0

很簡單,你基本上讀取文件並將結果放入列表中。然後,你可以在列表中的項目可以直接引用列表號...

set filePath to (path to desktop as text) & "memberID.txt" -- path to the file 
set idsText to read file filePath -- get the file text 
set idsList to paragraphs of idsText -- turn the text into a list 

set nextID to item 2 of idsList 

,或者你可以在他們所有的重複循環得到...

set filePath to (path to desktop as text) & "memberID.txt" -- path to the file 
set idsText to read file filePath -- get the file text 
set idsList to paragraphs of idsText -- turn the text into a list 

repeat with i from 1 to count of idsList 
    display dialog (item i of idsList) 
end repeat 
+0

所以這是的AppleScript閱讀文件並獲取成員ID?但我也需要使用automator來執行使用獲取的成員id的操作,我該如何將兩者結合起來? – 3zzy 2011-05-14 13:59:42