2013-10-10 2 views
3

Wirecast에서 미디어 파일 열기 스크립트를 작성하려고합니다. 특정 폴더의 모든 파일을 Wirecast "샷"으로 열려고합니다. Wirecast를 열고 사전에 따르면Applescript : 폴더의 모든 파일에 POSIX 경로 가져 오기

, 주사를 추가 할 수있는 AppleScript로 명령 구문은 다음과 같습니다

AddShotWithMedia 나는 목록을 얻으려면 두 방법을 알아낼 수 없습니다 posix_path와 계층아무것도

posix 경로를 폴더의 모든 파일에 연결하거나 아니면 AppleScript 경로를 Wirecast에서 사용할 수있는 posix 경로로 변환합니다. 이 메시지와 함께 AddShotWithMedia 줄에 실패 ...

tell application "Finder" 
    set SettingsFolder to folder "WirecastMedia" of home 
    set MediaFolder to folder "Titles" of SettingsFolder 

    set TitleList to entire contents of MediaFolder 
end tell 

tell application "Wirecast" 
    activate 
    set myFile to (file "KorgWirecast.wcst" of SettingsFolder) 
    open myFile as alias 
    set myDoc to last document 
    set myLayer to the layer named "Titles" of myDoc 

    repeat with aFile in TitleList 
     AddShotWithMedia myLayer with posix_path aFile 
    end repeat 

end tell 

:

여기에 코드입니다

Can’t make «class docf» "ManyVoicesSuper.png" of «class cfol» "Titles" 
of «class cfol» "WirecastMedia" of «class cfol» "ram" of «class cfol» 
"Users" of «class sdsk» of application "Finder" into the expected type. 

답변

4

file "ManyVoicesSuper.png of folder "Titles" ... of application "Finder"이 파일에 대한 파인더 참조입니다. 필요한 것은 POSIX 경로 형식의 문자열입니다. 난 당신이 하위 폴더를 포함하는 폴더의 entire contents을 사용하고 통지,하지만 당신은 단지 상위 폴더에서 파일을받을 필요가있는 경우, 당신은이 같은 시스템 이벤트를 사용할 수 있습니다

tell application "System Events" 
    set TitleList to POSIX path of disk items of folder "~/WirecastMedia/Titles" 
end tell 
+0

완벽! 고맙습니다! 나는 모든 시간을 하나의 형식에서 다른 형식으로 강제 변환하려고 애썼다. 이상하지만 큰 스크립트를 통해 두 가지 다른 경로 형식을 사용해야합니다. 경로 형식을 강제 변환하는 표준 방법이 있다고 생각할 것입니다. –

관련 문제