Jump to content

HELP - maxscript - script lister to list from a network location?


mattclinch
 Share

Recommended Posts

hey all.

really hoping some maxscript genius can solve this problem for me...

 

i am trying to rehash a bit of code from the Blurscript 'bsrun.ms', which essentially pulls in a list of available maxscripts from a specific directory and displays them in a dropdown allowing quick access.

 

currently part of the scripts reads as

 

fn bsrun_update = 
(
script_names = #()
script_files = get_all_files_in_dir ((getdir #scripts) + "\\BlurScripts\\") false "ms"
if script_files.count != 0 then
	(
	for i = 1 to script_files.count do
		(
		the_name = (filenameFromPath script_files[i])
		append script_names (strip_file_extension the_name)
		)
	)
)

fn bsr_io = 
(
bsr_ini_name = ((getdir #scripts) + "\\BlurScripts\\" + "BSRun.ini")
if openFile bsr_ini_name != undefined then
	(
	bsr_ini = openFile bsr_ini_name
	inputdata = readLine bsr_ini
	my_index = findItem script_names inputdata
	if my_index == 0 then my_index = 1
	last_script_index = my_index
	close bsr_ini
	)
else
	(
	bsr_ini = createFile bsr_ini_name
	format (strip_file_extension (filenameFromPath (script_files[the_script] as string))) to:bsr_ini
	close bsr_ini
	)
)

 

now if i wanted to point it to an existing mapped network location for my scripts, i would have thought i simply needs to change the lines that include...

 

((getdir #scripts) + "\\BlurScripts\\")

 

to something more like..

 

("z:\scripts\\")

 

but its doesn't like it. i know that the "getdir" element allows you quickly to point to a directory within the root max folder, so i assume i don't include it. i've also tried it with UNC paths and no joy either..

 

appreciate any help. ta.

 

M

Edited by mattclinch
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...