AppleScript 배우기 실습을하고 있는데 .xhtml
파일에 클래스 수를 얻을 수 있는지보고 싶었습니다.AppleScript로 클래스 수를 계산하는 방법은 무엇입니까?
set this_project to file of project document 1
과 함께 모든 .xhtml
파일을 대상으로 확인했다 : 내 BBEdit에서 프로젝트에서
내가 가진 프로젝트에 대한 변수를 설정
set total_xhtml to {search mode:grep, case sensitive:false, match words:false, extend selection:false, returning results:true, filter:{ID:"111232452", filter_mode:and_mode, filter_terms:{{operand:"xhtml", field:«constant ****FnSf», operator:op_is_equal}}}}
하지만 난의 클래스를 계산하려고 할 때 각 파일은 내가 우연히 만났어.
나는 시도했다 :
set varCount to count class=\"foobar\"" of (this_project in total_xhtml)
set varCount to count class=\"foobar\""
을 시도하면 AppleScript 편집기에서 숫자가 반환되지만 프로젝트의 각 파일에 대한 전체 개수는 어떻게 얻을 수 있습니까?