Apple 维基

global createRamDisk

run script createRamDisk

script createRamDisk


tell application "Finder"


set ErosMirrorDiskSize to display dialog {"

請嚫鱫的鰛鰇鱮美鱺沝女鰰鰎魞所需 RamDisk G 數唷💋"} default answer {""} buttons {"嗯哼。。好的唷💋"} default button 1

set ErosMirrorDiskSize to {text returned of the result}

set ErosMirrorDiskSize to {ErosMirrorDiskSize * 1024 * 2048}

do shell script {"hdiutil attach -nomount ram://" & ErosMirrorDiskSize}

set ErosMirrorDiskImg to {the result}

set ErosRamDisk to {the last text item of ErosMirrorDiskImg}

set ErosShellCmd to {" newfs_hfs -v 'Eros MirrorDisk' -s " & ErosRamDisk as text}

do shell script {ErosShellCmd}

do shell script {" diskutil mount " & ErosRamDisk}

(do shell script

rm -rf ~/Library/Caches ; 

cd /Volumes/'Eros MirrorDisk' ; 

mkdir -p _應用快取 下載 文件 影片 音樂 圖片 ; 

cd ~ ; 

ln -s /Volumes/'Eros MirrorDisk'/_應用快取 ~/Library/Caches " password ("沝女鰰的密碼") with administrator privileges)

end tell

continue quit

on error errmsg number errnbr

if errnbr = -128 then

continue quit

end if

set {button returned:ErosRamDisk} to continue quit

end try

end script