2013-07-03 2 views
1

몇 가지 외부 HD 중 하나를 확인하는 AppleScript가 있습니다. 내 컴퓨터에 연결하여 해당 내용의 색인을 만듭니다. 모든 HD는 명명 체계 HK_12345를 따릅니다. 처음 두 글자는 항상 같지만 숫자는 각 드라이브마다 다릅니다. 끝내기 번호와 관계없이 스크립트가 'HK'지정이있는 드라이브 만 확인하도록합니다. 내가 가지고 있지만 작동하지 않습니다. 어떤 충고?applescript에서 폴더 이름의 일부를 확인하십시오.

set folderContains to "HK_" 

tell application "Finder" 
    set triggerFolder to folder whose name contains folderContains 
end tell 

tell application "Finder" 
    if folder triggerFolder exists then 
    -- some other code 
    end if 
end tell 

답변

1

당신은 disks하지 folders 확인해야합니다 :

set diskContains to "HK_" 

tell application "Finder" 
    set selectedDisks to disks whose name contains diskContains 
    -- some other code 
end tell 
+0

감사합니다,이 완벽하게 작동! –

관련 문제