/
ํƒญ ์ด๋ฆ„์— ๋”ฐ๋ผ ์ธ์ฝ”๋”ฉ ๋ณ€๊ฒฝํ•˜๋Š” VB ์Šคํฌ๋ฆฝํŠธ

ํƒญ ์ด๋ฆ„์— ๋”ฐ๋ผ ์ธ์ฝ”๋”ฉ ๋ณ€๊ฒฝํ•˜๋Š” VB ์Šคํฌ๋ฆฝํŠธ

๋กœ์ปฌ ์…ธ์ด๋‚˜ ๋ช…๋ นํ–‰์œผ๋กœ ์„œ๋ฒ„์— ์ ‘์†ํ•œ ํ›„ ํƒญ ์ด๋ฆ„์— ๋”ฐ๋ผ์„œ ์ธ์ฝ”๋”ฉ์„ ๋ณ€๊ฒฝํ•ด ์ฃผ๋Š” ์Šคํฌ๋ฆฝํŠธ์ž…๋‹ˆ๋‹ค.

์‚ฌ์šฉ ๋ฐฉ๋ฒ•

  1. ๋„๊ตฌย โ†’ ์˜ต์…˜ย โ†’ ํ‚ค๋ณด๋“œ์™€ ๋งˆ์šฐ์Šค์˜ ํ‚ค ๋งคํ•‘์—์„œ ์„ธ์…˜ ์ธ์ฝ”๋”ฉ์„ ๋ณ€๊ฒฝํ•˜๋Š” ๋‹จ์ถ• ํ‚ค๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
  2. ์ธ์ฝ”๋”ฉ ๋ณ€๊ฒฝ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    sub main
    	xsh.screen.synchronous true
    	tabText = xsh.session.tabText()
    	Set objShell = CreateObject("WScript.Shell")
    
    	' key1, key2 ๋“ฑ์€ ์„ธ์…˜ ํƒญ์— ํ‘œ์‹œ๋˜๋Š” ๋‚ด์šฉ์˜ ์ผ๋ถ€์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    	servers = Array(_
    		Array("key1", "U")_
    		, Array("key2", "D")_
    		, Array("key3", "U")_
    		)
    	for j=0 to Ubound(servers)
    		if InStr(tabText, servers(j)(0)) > 0 then
    			if servers(j)(1) = "U" then
    				' xsh.dialog.msgbox("Changed to UTF8")
    				objShell.SendKeys "^%{u}"
    				' ์›ํ™œํ•œ ์ž‘๋™์„ ์œ„ํ•ด sleep๋ฅผ ๋„ฃ์–ด ์ค˜์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    				xsh.session.sleep 100
    			else
    				' xsh.dialog.msgbox("Changed to Default Language")
    				objShell.SendKeys "^%{d}"
    				xsh.session.sleep 100
    			end if
    			exit for 
    		end if
    	next
    end sub

    โ€ป ์ฃผ์˜: sendkeys์˜ ๋‚ด์šฉ๊ณผ ์œ„ 1์˜ ํ‚ค ๋งคํ•‘์ด ์ผ์น˜ํ•˜์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

  3. ๊ธฐ๋ณธ ์„ธ์…˜์˜ ์„ธ์…˜ ๋“ฑ๋ก ์ •๋ณดย '๋กœ๊ทธ์ธ ์Šคํฌ๋ฆฝํŠธ'์—์„œ ์œ„ 2์˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.
    โ€ป ์ฐธ๊ณ : ๋กœ์ปฌ ์…ธ ์ƒํƒœ์—์„œ ์„ธ์…˜ ๋“ฑ๋ก ์ •๋ณด๋ฅผ ์—ด ๊ฒฝ์šฐ ๊ธฐ๋ณธ ์„ธ์…˜์ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.
  4. ๋กœ์ปฌ ์…ธ์ด๋‚˜ CMD ๋ช…๋ นํ–‰์œผ๋กœ ์„œ๋ฒ„์— ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค.