아래 코드는 EasyRenamer 설치 시 기본적으로 제공되는 자바스크립트 코드 입니다.

Editor 내 모든 파일명을 가져와 콘솔 윈도우에 속성을 출력하는 샘플 코드입니다.

//  파일 개수를 얻는다.
var count = getFileCount();
if (0 == count) {
    alert("속성을 출력 할 파일이 없습니다.");
    return;
}
var properties = ["format","mime","size","date:creation","date:modified","date:access","time:creation","time:modified","time:access","media:artist","media:year","media:genre","media:album","media:#","duration","bitrate","framerate","Samplingrate","width","height","audio:channel","photo:aperture","photo:brightness","photo:cameramodel","photo:cameraserial","photo:exifversion","photo:exposurebias","photo:exposuretime","photo:flashmodel","photo:f","photo:focallength","photo:lensmodel","photo:meteringmode","photo:sharpness","photo:whitebalance"];

clearConsole();
showConsole(true);

//  진행바 범위를 설정한다.
setProgressRange(0, count);

//  진행바를 화면에 보인다.
showProgress(true);

//  파일 개수 만큼 파일명을 변경한다.
for (index = 0; index < count && !isStop(); ) {
    var extension = "";
    //  지정한 인덱스의 파일명을 얻는다.
    var fileName = getFileName(index);

    console("[" + 1 + index + "] " + fileName);
    for (prop = 0; prop < properties.length; ++prop) {
        console("    [" + properties[prop] + "] = " + getProperty(index, properties[prop]));
    }

    //  진행바의 위치를 갱신한다.
    setProgress(++index);
}

//  작업 완료 메시지를 출력한다.
alert("파일 속성 출력이 완료됐습니다.");

//  진행바를 숨긴다.
showProgress(false);

+ Recent posts