2011-08-16 2 views

답변

0

당신이 할 수 있습니까 : 여기에 좋은 튜토리얼 A) 응용 프로그램

그렇다면 귀하의 자동화 워크 플로우를 저장 루비 B)에서 명령 줄 프로그램을 실행, 당신은해야한다 open 명령을 실행할 수 있습니다. open test.app --args someArg. 또는 명령을 사용할 수 있습니다. echo "someArg" | automator -i - test.app

전체 Automator 스크립트가 각 인수에 대해 한 번 실행됩니다. 첫 번째 항목으로 '텍스트 말하기'를 사용해보십시오.

한 번에 모든 매개 변수로 작업하려면 실제로 하나만 전달한 다음 위로 나눠야합니다 (예 : open test.app --args "one|two|three|four" 무언가 그러나

 
on run input 
    set myArray to my theSplit(input as string, "|") 
    set a to item 1 of myArray 
    set b to item 2 of myArray 
    set c to item 3 of myArray 
    set d to item 4 of myArray 
    display dialog "c is " & c 

     --do stuff 
    return str 
end run 

on theSplit(theString, theDelimiter) 
    -- save delimiters to restore old settings 
    set oldDelimiters to AppleScript's text item delimiters 
    -- set delimiters to delimiter to be used 
    set AppleScript's text item delimiters to theDelimiter 
    -- create the array 
    --set theArray to every text item of theString 
    set theArray to text items of theString 
    --display dialog theArray as string 
    -- restore the old setting 
    set AppleScript's text item delimiters to oldDelimiters 
    -- return the result 
    return theArray 
end theSplit 

처럼 애플 스크립트는 그것이 첫 번째 작업이 아니라면 작동하는 것 같다. 첫 번째 작업으로 필요하다면 먼저 인수를 전달하는 실행 셸 스크립트를 삽입하십시오.

 
for f 
do 
    echo “$f" 
done 
-1

예, 매개 변수를 루비 스크립트에 전달할 수 있습니다.

http://ruby.about.com/od/rubyfeatures/a/argv.htm

+0

답장을 보내 주셔서 감사합니다.하지만 제 질문에 대한 답변을 생각하지 않았습니다. 루비 스크립트의 매개 변수를 내 자동화 작업 흐름으로 전달하려고합니다. – thisiscrazy4

관련 문제