2012-11-10 4 views

답변

2

스크립트 개체를 사용하여 비공개 장소에 데이터를 저장할 수 있습니다.

Automator

on run 
    -- Path of script which holds data 
    set thePath to (path to desktop as text) & "myData.scpt" 
    --set thePath to (path to preferences as text) & "myData.scpt" -- better 

    script theData 
     property xxx : missing value 
    end script 

    try 
     set theData to load script file thePath 
    on error 
     -- On first run, set the initial value of the variable 
     set theData's xxx to 5 
    end try 

    -- change the value of the variable 
    set theData's xxx to (theData's xxx) + 1 

    -- save your changes 
    store script theData in file thePath replacing yes 
    return theData's xxx 
end run 
+0

+1 난 그 생각하지 않았하고 복잡한 데이터 클래스 아마 좋아요. – regulus6633

+0

감사합니다 ...이 스크립트는 [AppleScript : The Definitive Guide] (http://shop.oreilly.com/product/9780596102111.do)의 예제에서 채택되었습니다. – adayzdone