2012-03-29 4 views
1

거기에 OSX에서 바탕 화면의 세부 정보를 읽거나 쿼리하는 방법이 있습니다. 파일 &과 같은 정보를 가져오고 싶습니다. 위치에 폴더가 데스크탑에 표시됩니까?바탕 화면의 아이콘과 파일에 대한 세부 정보를 바탕 화면에 표시합니다.

NSFileManger에서 다음 api를 사용할 수 있으며 파일과 폴더를 제공 할 수 있다고 생각합니다.

- (NSArray *)contentsOfDirectoryAtURL:(NSURL *)url includingPropertiesForKeys:(NSArray *)keys options:(NSDirectoryEnumerationOptions)mask error:(NSError **)error 

그러나 데스크톱 파일 위치와 해당 아이콘이 필요합니다. 누구든지 나를 도와 주거나 아이디어를 제안 할 수 있습니까?

답변

-1

아이콘 당신이 바탕 화면 항목의 위치를 ​​AppleScript을 사용할 수 있습니다

[NSWorkspace sharedWorkspace] iconForFile:filePath]; 

를 사용할 수 있습니다.

tell application "Finder" to ¬ 
    get the name of every item of desktop 
tell application "Finder" to ¬ 
    get the position of every item of the desktop 
+0

스크립팅을하지 않고 수행 할 수 있습니까? – MacGeek

관련 문제