2011-05-14 3 views
0

필자는 .txt 형식으로 한 줄에 하나의 memberID로 구성된 수백 개의 회원 목록을 가지고 있으며,이를 Automator를 사용하여 웹 응용 프로그램에 추가해야합니다.Automator/Applescript로 데이터 입력?

그래서 TXT는 같은 것입니다 :

30335842 
30335843 
30335844 
... 

는 그리고 웹 페이지에 삽입해야하지만 내가 자동화를 사용하여 작업을 만들 수 있기 때문에 내가 쉬운 부분 이잖아 같아요.

매번 자동화 작업 과정에서 사용할 새 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를 얻으려면? 하지만 가져온 멤버 ID를 사용하여 작업을 수행하려면 자동화를 사용해야합니다. 어떻게 둘을 결합합니까? – 3zzy