Default directory

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
davestewart
Posts: 114
Joined: March 10th, 2005, 5:50 am
Location: London, UK
Contact:

Hi All,
It's been a while since I've touched AE scripting, and I've (probably) forgotten the answer to this one.

Is there any way to set a default or working directory - other than the AE Script directory? I want to set it so a user can run scripts from an external application, and have AE operate on that particular folder by default (without a long protracted path name, every time).

ie...

Code: Select all

setActiveDirectory('c:\temp\scripts')
Then, later, when I do something like...

Code: Select all

f=file('sample.txt')
... it knows where it is!

Thanks,
Dave
davestewart
Posts: 114
Joined: March 10th, 2005, 5:50 am
Location: London, UK
Contact:

I'll play with

Code: Select all

Folder.current
vidpat
Posts: 86
Joined: October 21st, 2004, 12:36 am
Location: Phoenix, AZ
Contact:

You could always stick the path in a variable and concatenate it with the file name, as needed:

Code: Select all

var cwd = "C:\\temp\\scripts\\";

// ...

f = file(cwd + "sample.txt");
davestewart
Posts: 114
Joined: March 10th, 2005, 5:50 am
Location: London, UK
Contact:

Thanks vidpat,

Sure I could - and that's probbaly what I'll end up doing.

For the record, Folder.current only worked for teh current evaluation of a script. As soon as it was done executing, Folder.current reverted back to /Support Files.

It seems odd (but understandable) that you can't set it!

Any more ideas?

Thanks,
Dave
Post Reply