ScriptSpot home

Find Script By String

Downloads

3ds Max compatibility
See original listing claims
Community compatibilityNo compatibility reports yet

No reports yet for the available releases.

Community reviewsNo reviews yet.

Listing details

Version
1.0
From original requirements
2009
Original version requirement
3ds Max 2009
Author’s update date
Legacy votes
17
Listing created
How compatibility works

Compatibility comes from the author’s supported range or requirements in the original listing. A tested version records what the author tried.

“2020 unconfirmed” in the catalog means support for 3ds Max 2020 is still unknown.

Community reports record successful tests on specific releases.

Posted by

Anubis

Panayot Karabakalov

More by this author

Description

Recursive search in selected directory for string inside .ms scripts and finally double click on item in list of matches result to load the script for editing.

Comments (4)
Nikolay Litvinov

Круто, спасибо. Но не работало для вводимого пути напрямую. Немного подкорректировал.
Cool, thanks. But it did not work for the input path directly. A little tweaked.


-- Find Script By String v.1.0 [2009-06-27]
-- by Karabakalov (Anubis) anubiss@abv.bg
if findScriptDlg != undefined then destroyDialog findScriptDlg
rollout findScriptDlg "Find Script By String" width:800 height:600
(
	local allMSfiles = #()
	local result = #()
	-- UI items
	edittext ed_currDir "" width:746 across:2
	button bt_srcDir "..." height:18 align:#right
	edittext ed_search "" width:773
	multiListBox mlb_files "" width:773 height:40
	label lb_result "Enter string to search..."
	-- Functions
	fn getFilesRecursive root pattern =
	(
		dir_array = GetDirectories (root+"/*")
		for d in dir_array do
			join dir_array (GetDirectories (d+"/*"))
		join dir_array (GetDirectories root)
		my_files = #()
		for f in dir_array do
			join my_files (getFiles (f + pattern))
		my_files
	)
	fn searchFn = (
		result = #()
		setWaitCursor()
		for f in allMSfiles do
		(
			s = openFile f
			while not eof s do
			(
				find = readLine s
				if findString find ed_search.text != undefined then
				(append result f ; exit )
			)
			close s
			result
		)
		lb_result.text = (result.count as string) + " files found"
		if result.count > 0 then
		(mlb_files.items = result ; lb_result.text += " -- Double Click to Edit...")
		setArrowCursor()
	)
	-- Events
	on ed_search entered txt do
	(
		if txt != "" then searchFn()
		else lb_result.text = "Enter string to search..."
	)

	on ed_currDir entered txt do
	(
	d = ed_currDir.text
	allMSfiles = getFilesRecursive ed_currDir.text "*.mcr"
	)

	on bt_srcDir pressed do
	(
		d = getSavePath caption:"Where to Search..." initialDir:"$scripts"
		if d != undefined then
		(
			ed_currDir.text = d
			allMSfiles = getFilesRecursive ed_currDir.text "*.ms"
		)
	)
	on mlb_files doubleClicked itm do
		if mlb_files.selection != 0 then edit mlb_files.items[itm]
	on findScriptDlg open do
	(
		ed_currDir.text = (getDir #scripts)
		allMSfiles = getFilesRecursive (getDir #scripts) "*.ms"
	)
)
createDialog findScriptDlg style:#(#style_titleBar, #style_border, #style_sysMenu, #style_minimizeBox)
br0t

I like :)

kilad

hm. Have you tried ctrl + shift + F in mxs editor?

Nevil Redfield(Nasser Merati)

Cool

This is great idea and useful tool.