PDA

¸ðµç ±â´ÉÀ» Æ÷ÇÔÇØ¼­ º¸±â : AppleScript: ÆÄ¿öºÏ ³»À帶ÀÌÅ© º¸À̽º·¹ÄÚµù Äü¼Â¾÷


albireo
2005/07/02, 10:50 PM
ÆÄ¿öºÏÀÇ ³»À帶ÀÌÅ©·Î º¸À̽º·¹ÄÚµùÀ» ÇÏ·ÁÇÒ ¶§, ¸Å¹ø

1. ÀÎDz°ÔÀÎÀ» ÃÖ´ë·Î ´Ã¸®°í,
2. ¿¡ÄÚ¸¦ ¸·±â À§ÇØ ³»À彺ÇÇÄ¿ º¼·ýÀ» Á×À̰í,
3. »ç¿îµåÀÔ·ÂÀåÄ¡¸¦ ³»À帶ÀÌÅ©·Î ¼¼ÆÃÇÏ´Â ÀÌ ¼¼°¡Áö ÀÏÀÌ ¹ø°Å·Ó°Ô »ý°¢µÇ¾î,

GUI Scripting µµ ÀÍÈú °â ¾ÖÇýºÅ©¸³Æ®·Î ¸¸µé¾î º¸¾Ò½À´Ï´Ù ;-)

-- This script sets sound input device of PowerBook to "Internal microphone", input volume level to maximum, and output volume level to minimum, and launch QuickTIme Player, voice recording window.
-- Written by Hongsun Yoon, M.D., Albireo Project, June 2005

tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
end tell

tell application "System Events"
if UI elements enabled then
tell slider 1 of group 1 of window 1 of process "System Preferences"
set value to 0
end tell
click radio button "Input" of tab group 1 of window 1 of process "System Preferences"
tell slider 1 of group 2 of tab group 1 of window 1 of process "System Preferences"
set value to 1.0
end tell
set theRows to every row of table 1 of scroll area 1 of tab group 1 of window 1 of process "System Preferences"
set theOutputs to {} as list
repeat with aRow in theRows
if (value of text field 1 of aRow as text) is equal to "Internal microphone" then
set selected of aRow to true
exit repeat
end if
end repeat
tell application "System Preferences" to quit
else
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""
end tell
end if
end tell

albireo
2005/07/02, 11:21 PM
¸¸ÀÏ QuickTime Player ÀÇ "»õ ¿Àµð¿À ·¹ÄÚµù" À©µµ¿ì±îÁö ÇÔ²² ¶ç¿ì°í ½Í´Ù¸é, "tell application "System Preferences" to quit" °ú "else" »çÀÌ¿¡ ¾Æ·¡ ½ºÅ©¸³Æ®¸¦ Ãß°¡ÇØ ³ÖÀ¸¸é µÇ°Ú½À´Ï´Ù.

tell application "QuickTime Player"
activate
end tell
tell application process "QuickTime Player"
click menu item "New Audio Recording" of menu 1 of menu bar item "File" of menu bar 1
end tell