2012-12-03 2 views
0

모든, 나는 쉘 명령을 실행 코코아 - AppleScript로 응용 프로그램을 가지고 "설치"푸시 버튼을 클릭하면 (사용자 입력에 따라 호스트 이름을 설정) :라디오 버튼 값 엑스 코드를 가져옵니다 4 AppleScript로

on InstallButton_(sender) 
    set hostName to "" 
    set hostName to textField's stringValue as string 
    do shell script ("/usr/sbin/scutil --set HostName " & hostName) with administrator privileges 
    do shell script ("/usr/sbin/scutil --set ComputerName " & hostName) with administrator privileges 
end InstallButton_ 

3 개의 라디오 버튼을 추가하여 프로그램을 확장하고 싶습니다. "설치"푸시 버튼을 눌렀을 때 이러한 라디오 버튼 (목록) 중 일부 또는 전부가 선택되면 각 라디오 버튼과 관련된 명령을 실행하고 싶습니다. 따라서 첫 번째 2 라디오 버튼 만 선택하는 경우 두 개의 명령 만 실행하십시오.

라디오 버튼 매트릭스의 선택된 값을 어떻게 얻을 수 있습니까?

+0

하지만 I 찾을 수 있었던 경우 체크 박스를 사용하여 정확한 결과를 얻는 방법. 속성 체크 박스 :없는 값 세트 checkBoxValue을 ""문자열 #display 대화 checkBoxValue으로 체크 박스의 integerValue에 설정 checkBoxValue 경우 checkBoxValue = 1 #run 정책 끝 체크 박스가 checkBoxValue 매개 변수를 확인하는 경우 = 1 체크하지 않으면 값은 0입니다. – user1582375

답변

0

라디오 버튼 (목록)을 사용하여 해결책을 찾을 수 없었지만 확인란을 사용하여 정확한 결과를 얻는 방법을 알 수있었습니다.

property checkBox : missing value 
set checkBoxValue to "" 
set checkBoxValue to checkBox's integerValue as string 
#display dialog checkBoxValue 
if checkBoxValue = 1 
    #run policy 
end 

체크 박스는이 값을 선택하지 않은 경우 checkBoxValue 변수 = 1 체크 나 라디오 버튼 (list)을 이용하여 솔루션을 발견 할 수 않네 0