# \[파이썬\] 그림이 포함된 문자열

**URL:** <https://forum.developer.hancom.com/t/topic/669>\
**Category:** 한글 오토메이션\
**Created:** [5월 10, 2023, 8:08오전 UTC](https://forum.developer.hancom.com/t/topic/669 "2023-05-10T08:08:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user25](https://avatars.discourse-cdn.com/v4/letter/u/e56c9b/32.png) [@user25](https://forum.developer.hancom.com/u/user25)\
**Post date:** [5월 10, 2023, 8:08오전 UTC](https://forum.developer.hancom.com/t/topic/669/1 "2023-05-10T08:08:04Z")

</div>

그림이 포함된 문자열에서 gettext를 적용하니 전혀 문자를 읽어 들이지 못하네요…

1. 문자열에서 그림개체의 위치 추출 방법
2. 그림개체를 제외한 문자열 추출하는 방법

방법이 있는지요?

---

<div class="post-metadata">

**Author:** ![bhjung](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/bhjung/32/259_2.png) [@bhjung](https://forum.developer.hancom.com/u/bhjung)\
**Post date:** [5월 10, 2023, 11:59오후 UTC](https://forum.developer.hancom.com/t/topic/669/2 "2023-05-10T23:59:53Z")

</div>

1의 경우 예외사항이 많아서 정확한 가이드가 어려울것 같습니다 ㅠ …  
원하는 컨트롤(이미지)를 정확시 선택 가능하다면 해당 위치로 이동후 GetPos를 통해 위치는 알수있을것 같습니다.

2.의 경우 아래와 같이 테스트 코드를 적용했을때 그림을 제외한 문자열 추출이 가능한데 혹시 동작을 안하실까요?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/hancom_dev_forum/original/1X/86d7ed73ed430d0693a118d5631c62ca37fb39ad.png)

```auto
function OnScriptMacro_script16()
{
	var text = GetTextFile("TEXT","");
	HAction.GetDefault("InsertText", HParameterSet.HInsertText.HSet);
	HParameterSet.HInsertText.Text = text;
	HAction.Execute("InsertText", HParameterSet.HInsertText.HSet);
}

```

감사합니다 ^^
