2017-11-02 13 views
0

그래서 사용자 입력이있는 폴더를 만드는 AppleScript 스크립트를 작성하려고했지만 불행히도 제대로 작동하지 않습니다. 어떤 도움을 주셔서 감사합니다.폴더를 만들고 이름을 지정하는 스크립트 편집기

set theResponse to display dialog "Enter the name of folder" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue" 
display dialog "Name of the folder: " & (text returned of theResponse) & "." 
tell application "Finder" 
    make new folder at desktop with properties {name:"theResponse"} 
end tell 
+0

스크립트 작성에 무엇을 사용하고 있습니까? bash, node.js ...? – stealththeninja

+1

@stealththeninja : 저에게 AppleScript (Script Editor의 기본 언어)처럼 보입니다. – Ssswift

+0

질문 아래에서'편집 '을 클릭하고 코드를 선택하고 코드 포맷 아이콘'{}'을 클릭하십시오. –

답변

1

가 여기에 작동 코드의 수정 된 버전입니다 :

set theResponse to text returned of (display dialog "Enter the name of folder" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue") 
display dialog "Name of the folder: " & theResponse & "." 
tell application "Finder" 
    make new folder at desktop with properties {name:theResponse} 
end tell 

을 원래 코드, {name:"theResponse"}에서 "theResponse"와 따옴표, 말 그대로 theResponse하지 the text returned입니다.

그래서, 코드의 첫 번째 줄에서, 나는 그것이 나중에 스크립트 등을 참조 할 필요가 없다, 그래서 the text returnedtheResponse변수 설정으로 시작했다. 코드 번째 라인

따라서 (text returned of theResponse)

이제 값이 변수의 포함 단지 theResponse을 설정한다. 그것은 name 특성make new folder 할 때가 지금

따옴표없이 theResponse,이며, 그것은 이미 코드의 첫 번째 줄에서 the text returned이 포함되어 있습니다.