if exists
(
folder "temp" of drive of system folder
)
then
(
(
if
(
0<
(
it /
(
1024*1024*1024*1024
)
)
)
then
(
it /
(
1024*1024*1024*1024
)
)
as string & " TB" else if
(
0<
(
it /
(
1024*1024*1024
)
)
)
then
(
it /
(
1024*1024*1024
)
)
as string & " GB" else if
(
0<
(
it /
(
1024*1024
)
)
)
then
(
it /
(
1024*1024
)
)
as string & " MB" else if
(
0<
(
it /
(
1024
)
)
)
then
(
it /
(
1024
)
)
as string & " KB" else
(
it as string & " B"
)
)
of
(
sum of sizes of descendants of folder "temp" of drive of system folder
)
)
else ERROR "no Temp Dir"
if exists (folder "temp" of drive of system folder) then ((if (0<(it / (1024*1024*1024*1024))) then (it / (1024*1024*1024*1024)) as string & " TB" else if (0<(it / (1024*1024*1024))) then (it / (1024*1024*1024)) as string & " GB" else if (0<(it / (1024*1024))) then (it / (1024*1024)) as string & " MB" else if (0<(it / (1024))) then (it / (1024)) as string & " KB" else (it as string & " B")) of (sum of sizes of descendants of folder "temp" of drive of system folder)) else ERROR "no Temp Dir"