2011-02-27 7 views
1

내가 아이튠즈 뮤직 폴더의 경로에 대한 경우 애플 변수를 설정하려면 아래의 코드를 가지고있는 파일 :복사 AppleScript로

set username to text returned of (display dialog "RingtoneDude" default answer "Enter your path to your iTunes Ringtones folder here. e.g. /Users/David/Music/iTunes/iTunes Music/Ringtones" buttons {"Confirm", "Cancel"} default button 1) 

그리고 나서 파일을 복사 할 변수 이름을 호출하는 코드가를

tell application "Finder" 
       copy file theCopy to username 
      end tell 

그러나 데스크탑에있는 theCopy (사본은 변수 임)는 폴더로 이동하지 않습니다.

도와주세요.

답변

3

나는 alias을 반환하는 choose folder을 사용할 것을 제안합니다.

일부 텍스트를 별칭 개체로 만들려면 set myAliasPath to myTextPath as alias을 사용하십시오.

자세한 내용은 AppleScript 설명서의 Aliases and Files을 참조하십시오.

4

나는 copy 명령을 잘못 이해했다고 생각합니다. copy 명령은 한 변수의 내용을 다른 변수로 전송하는 데 사용됩니다. 사용하고자하는 것은 파일을 지정된 위치로 복사하는 데 사용되는 duplicate 명령입니다.

set myRingtoneFolder to choose folder with prompt "Select your iTunes Ringtone folder:" 
tell application "Finder" to duplicate theCopy to myRingtoneFolder 
:
duplicate [alias] to [alias] 
    [replacing boolean] --If true, replaces files in the destination with the same name 

이 우리아 목수의 대답과 함께 새로운 코드는이 같은 모양해야했다 가졌 다음과 같이 구문은
관련 문제