Thursday, May 28, 2020

#1 2010-05-27 03:10:49 pm

CalvinFold
Member
Registered: 2006-04-12
Posts: 639

Where to write temporary files?

If I have a script that needs to write temporary files while it works, is there a "standard" location for such files to go?

Right now just testing on my desktop, but would prefer to hide them during the normal function of the script.


Kevin
---
"How glorious it is--and also how painful--to be an exception." (Musset)

Offline

 

#2 2010-05-27 03:14:44 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11686
Website

Re: Where to write temporary files?

Hi,

there is a standard location

Applescript:

path to temporary items


regards

Stefan

Offline

 

#3 2010-05-27 03:46:35 pm

CalvinFold
Member
Registered: 2006-04-12
Posts: 639

Re: Where to write temporary files?

Nice and easy...thanks!


Kevin
---
"How glorious it is--and also how painful--to be an exception." (Musset)

Offline

 

#4 2010-05-28 12:44:55 am

Martin Michel
Administrator
From:: Berlin, Germany
Registered: 2008-03-03
Posts: 701
Website

Re: Where to write temporary files?

Hi,

Just for the sake of completeness:

Applescript:


path to temporary items from user domain

This returns the temporary items folder of the current user.

Best regards from cloudy-cold Berlin,

Martin


Plonum - Convert images to iWork Numbers documents

Offline

 

#5 2010-05-28 10:41:56 am

porkozone
Member
From:: Murfreesboro, TN
Registered: 2008-01-30
Posts: 85

Re: Where to write temporary files?

Martin Michel wrote:

Hi,

Just for the sake of completeness:

Applescript:


path to temporary items from user domain

This returns the temporary items folder of the current user.

Martin


So in practice what is the difference in using the user domain version rather that the "path to temporary items" version? I've used "path to temporary items" will no apparent ill effects, other than the path that is returned is something like "Macintosh HD:private:var:folders:Rc:RcA68ahPFN8khL25MNw4k++++TQ:TemporaryItems:" (and the string of numbers in the middle is not always the same) but if you open it up in the Finder the path is more normal looking. It also appears this folder is the one many other apps use to store temp items.

Using the user domain version seem to make more sense, but I am curious if there are any things I would need to know before I switched all my existing scripts to use it.


Scott Dye

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)