Search for primary file + Sub-folders
Okay, I know how to locate a specific file in a specified place; but now I need a way to locate a specific file in a general situation. Basically I have a library of textures with their exact file name. Well, I still don't know their exact location. For example, I have to run through my script "brushed_aluminum.jpg" textures, but I don't know exactly where it is, I just know that it's somewhere in my file textures (c:\textures\ for the sake of simplicity). Now, in c:\textures\ there are several subfolders (and possibly sub-sub-folders, etc.) it might be in. How would I go to have the script to find the file in this location, then get his exact path and store the exact path + name of file to a variable? Thanks for any help!
dgolberg
Edit: I had 2 other questions, but I was able to resolve myself.
Adding the last example...
function main(){ var Path = File($.fileName).parent; var csvFile = File(Path + "/csvFile.csv");//csv file var errorLog = File(Path + "/errors.txt");//error log $.os.search(/windows/i) != -1 ? errorLog.lineFeed = 'windows' : errorLog.lineFeed = 'macintosh'; if(!csvFile.exists){ alert("Unable to find CSV file!"); return; } var sourceFolder = Folder.selectDialog("Please select Folder where files are to be found"); if(sourceFolder == null) return; var folders =[]; folders = FindAllFolders(sourceFolder, folders); //get a list of all sub folders folders.unshift(sourceFolder); csvFile.open('r'); var data=[]; csvFile.readln(); //do not process the header line while(!csvFile.eof){ var line = csvFile.readln().replace(/^\s+|\s+$/g, ''); //remove leading and trailing spaces if(line.length>3) data.push(line); //Make sure it's not a blank line } csvFile.close(); for(var a in data){//process your files var bits = data[a].split(','); for(var z in folders){//loop through all folders to find file var file = File(folders[z] + "/"+bits[0]); if(file.exists) break; } if(!file.exists) {//if file not found it is logged in error file. errorLog.open('e'); errorLog.seek(0,2); errorLog.writeln(bits[0] + " could not be found"); errorLog.close(); continue; } //open (file); //runaction //app.doAction(bits[1].toString(), bits[2].toString()); //do whatever //save and close you document alert(file +"\r will be running action - " + bits[1].toString() + " actionSet = " + bits[2].toString() ); } } function FindAllFolders( srcFolderStr, destArray) { var fileFolderArray = Folder( srcFolderStr ).getFiles(); for ( var i = 0; i < fileFolderArray.length; i++ ) { var fileFoldObj = fileFolderArray[i]; if ( fileFoldObj instanceof File ) { } else { destArray.push( Folder(fileFoldObj) ); FindAllFolders( fileFoldObj.toString(), destArray ); } } return destArray; }; main();
Tags: Photoshop
Similar Questions
-
In Windows XP, when I go to 'Start' in the 'search' and specify a word in the name of the file and then highlight that it is a PDF file I'm looking for, it is unable to locate the file. I know that the file is there. Why is this happening?
WHERE you 'to highlight that it is a PDF file? I don't see this option in the SEARCH on my XP SP3 System.
Assuming you start from START - SEARCH - for the FILES or FOLDERS - all THE FILES AND FOLDERS, you must then fill the box 'All or part of the name of the file', and then may set at glance if you want to restrict the search and finally click FIND.
If you do not have a lot of pdf files on your system, you might consider simply using PDF as the 'part of the name of the file' and let Windows find all your pdf files.
-
where can I get additional icons for my files and folders in xp
I need additional icons for my files and folders on windows xp is there a site where I can download for free and instantly put them in the folder icon
Hi Robert,.
I see that you want additional icons for files and folders in xp. I'll help you with this problem.
1. What is the brand and model of the computer?
2. what security software is installed on the computer?
3. what icons are you looking for?
I suggest using your favorite search engine and look for all Web sites for free icons. You can download the icons based on the category and the icon you want. If you have downloaded a package of any icon, click on the downloaded zip file. The file will unpack once you click on it and reveal the subfolders as 'PNG' "ICO" or "Readme." Click the folder for the ICO to reveal the different icons in the package. Click on one of the icons to see what it looks like.
To make a shortcut to a folder and change the look of the shortcut icon:
1 - Open my computer and locate the folder you want.
2-click right on the folder and then click create a shortcut. If you are prompted to place the shortcut on the desktop, click Yes.
3-click right on the shortcut you created, click Properties, and then click change icon.
4 - Click on the picture of the icon you want the shortcut to use, click OK, and then click OK.
Let us know if you need assistance with any windows problem. We will be happy to help you.
-
Remove the black search box that says start typing to search for applications, files, and settings
Can someone tell me please how to permanently delete this search field that keeps appearing in different applications that I use?
I have windows 10 on a HP laptop. Often when I'm working in an application and I move the cursor on the screen, this search box - start typing to search for applications, files, and settings - appears. I tried several times to turn it off, but I do not just because I can't seem to get rid of it.
I would like it removed permanently or turns off permanently so it is not continue to block my view of the application, that I'm trying. Any suggestions would be greatly appreciated.
Thank you.
Terry20
Found this.
Click on the Start button and select settings.
Then select devices.
Click on the mouse and touch pad and scroll down and select 'extra mouse Options '.
This will open a box that should have the information and the name of the type of touchpad has your computer.
Click on settings and then in the new box that opens, you should see a tab that says 'Tapping '.
Open this tab and you should see 'Three finger Tap' and 'four finger Tap.
Clear the check boxes, and then click 'apply '.
REO
-
When I look at a photo, PC keeps "searching for missing file.
PC was overloaded with thousands of photos. I cut and pasted on a separate hard drive.
Now, I tried to copy and paste on the drive C on the PC.I see the images of out-of-focus, with a dialog box saying "searching for missing file.Help?Conway MHi M Conway,
Thanks for posting your question in the Microsoft Community!
To be able to understand the question in a better way than to provide you with the exact resolution, I would like to know exactly the problem you are experiencing.
(1) what photo viewer are you using?
Please send us the screenshot:
Please post is back with more information to help you solve the problem as soon as possible.
-
I tried to launch my Spysweeper and found that is not there, then I re downloaded and I could not install it because it was already on my computer. I went to the control panel to remove and got the message:
Windows cannot find C:\WINDOWS\system32\rundll32.exe. Make sure you typed the name correctly and then try again. To search for a file, select the Start button and then check the search...
What should I do?
Hi gsrow,
You can go there!
Cannot find the Rundll32.exe file when you open the control panel:
http://support.Microsoft.com/kb/812340Alternatively, copy the folder C:\Windows\System32\DllCache Rundll32.exe file to the System32 folder. Ramesh Srinivasan, Microsoft MVP [Windows Desktop Experience]
-
I try to search for a file... choose any file name... like 'cat' but get everthing that doesn't even look like a cat. I can get a list of files of a thousand, but anything containing same cat in the filename OR in the file. No idea what I am doing wrong?
John
Hello
"Maybe" there is something in the search Index that is causing a problem or try the advanced options
Search.Windows Search does not work or research are slower
http://support.Microsoft.com/GP/windows_searchTroubleshooting Windows Vista search & indexing errors
http://www.WinVistaClub.com/T24.htmlReconstruction of the Index in Windows Vista
http://www.howtogeek.com/HOWTO/Windows-Vista/rebuilding-the-search-index-in-Windows-Vista/
How to enable or disable the search Index in Vista
http://www.Vistax64.com/tutorials/69564-index-enable-disable.html
Improve Windows searches using the index: frequently asked questions
http://Windows.Microsoft.com/en-us/Windows-Vista/improve-Windows-searches-using-the-index-frequently-asked-questions================================
Tips for finding files
http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-finding-filesHow to use advanced search in Vista Options
http://www.Vistax64.com/tutorials/75451-advanced-search.htmlHow to restore the page button on the Start Menu after installing Vista SP1
http://www.Vistax64.com/tutorials/145787-Search-start-menu-button-restore-after-SP1.htmlHow to restore the context Menu item search after installing Vista SP1
http://www.Vistax64.com/tutorials/134065-search-context-menu-item-restore-after-Vista-SP1.htmlHow to create a shortcut on the desktop search in Vista
http://www.Vistax64.com/tutorials/126499-search-desktop-shortcut.html----------------------------------------------------------
Win Key F opens advanced search
Searching in Windows Vista, part 1
http://Windows.Microsoft.com/en-us/Windows-Vista/searching-in-Windows-Vista-part-1-secrets-of-the-search-boxI hope this helps.
Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.
-
"Can not open AsIO.sys (2)" I get this message when I log in after a reboot. I have search for the file, but can't find it with the research or the command prompt. What do do in this file, and can be created and put into the appropriate folder?
Hi Jack,
This driver belongs to AsIO.sys Asus Probe. Try to uninstall Asus Probe and if you need, install again. If this does not help, uninstall Asus Probe and other tools of control such as Speedfan. Open the registry (regedit.exe) editor and search for AsIO.sys and remove all the entries that you can find.
André
"A programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/ -
How can I use windows search to search for pdf files containing a specific word?
I have a folder with several pdf files. When I use windows search for a word that I know exists in one of the files, I get no results. It does not work when I use the content: either.
How can I use windows search to search for pdf files containing a specific word?
Do I need to install something to activate search within .pdf?
If you use Win7 32 bit, the iFilter is bundled with Acrobat Reader 9. On Win7 64-bit, you will need to install it separately.
http://www.Adobe.com/support/downloads/detail.jsp?ftpID=4025
Peter
-
How can I search in Windows 7 for all files not containing a speific (_) character in the file?
I have two files with about 50 000 files in each folder. There are many copies of the same file (only one folder contains photos, the other file has data files. In the two files copies have the same name as the original file, for example IMG01, but identified for example IMG01_1, IMG01_2, etc..)
I would like to find all files that DO NOT have a _ in them. Can I do this? How?
Or I have to search for all files that have a _ by searching for * _ *? Delete these files?
I tried, but program trotted for 2 hours. Just take a while?
I thought that if I could search only files without the _ it would be more effective.
Less than 20% of the files in each folder have not a _ in them.
You should be able to use a? or * to replace a number of characters that are either unique or variable. * book would find both book and facebook, or? ook would only book.
Anyway, there's probably not a way to identify the files corrupted by a search.
-
Search for all files? Search by creation date?
How can I search within all files? I know that the files are there and contain the words I'm looking for, but Windows cannot find them. Some files do not have extensions, some have a .bak extension and some have various other extensions.
Also, I see an option to search by modification date, but not created. How can I search for all files on my hard drive, created on a particular date (including the .dll, .exe, etc..). I'm trying to find all the files that were installed with an application. The files have different change dates, but all have the same creation date (when the application has been installed).
I do not understand how that returns results for all files (including non indexed files). Can you please explain?
The search interface has been simplified at the request of the overwhelming majority of users. Until a more sophisticated user, you liked the very high amount of control WHAT XP gave it. The new interface 7 has fewer orders. When the research opens, you will see an "additional search... "Computer" and other. Since you are obviously in control of syntax, the interface for non indexed opening files is quite simple. There is always the option to expand the index to include everything. (Control panel/Indexing Options)
If your index still don't "look in" a file, you can try to assign an 'association' for the file type. I have no idea what the .xyz file type might have as a native association, but you can associate this notebook. (right-click, open with, choose default program..., see the box always 'use..')
Messages rating helps other usersMark L. Ferguson MS - MVP
-
How can search for a file by date of creation in c programming please help me please!
I want to search for a file using a date, then the output should be a value for this file!
These forums are intended mainly the consumer so you probably better ask in the most relevant forums TechNet/MSDN from Microsoft here:
http://social.technet.Microsoft.com/forums/en-us/categories/
http://social.msdn.microsoft.com/Forums/en-US/categories .
Thank you. :)
-
HOW TO MAKE ICONS FOR ALL FILES AND FOLDERS IN LARGE WINDOW 7
HOW TO MAKE ICONS FOR ALL FILES AND FOLDERS IN LARGE WINDOW 7
You can try this: -.
Start-> Control Panel-> displayFrom there, you can select medium or large. This will be the size of everything on the screen. -
How to search for .ico files in Windows?
I write on behalf of a client.
She has problems using the search feature in Windows 7. She tries to find its system for all types of files .ico, but has so far only not successful. The file type is not listed as a file type supported for Windows Search, and when she tried several search commands to find on his PC, nothing relevant comes up.
Is there an order of specific research, it should use or an another workaround to find the types it needs?
Thank you very much!
Hello
I imagine the inconvenience that you are experiencing. I will certainly help the question of fixing.I suggest you follow the steps described in the links to search for a file and check the question below:Find a file or folder:
http://Windows.Microsoft.com/en-us/Windows7/find-a-file-or-folderI hope that the information above helps you. -
I tried to search for the file opm.db in the OOBE folder, but it is not there.
I tried to search for the file opm.db in the OOBE folder, but it is not there.
I turned off my computer and back then and it works now.
Maybe you are looking for
-
I try to access a Web site for more information and the link takes me to a page in a pictographic language (Japanese, Chinese, Korean). I can't find out how to ask Google or Firefox to translate the page in English. Someone knows how to do this? Than
-
WebSocket on Windows 8 bad work.
I try to test websocket support Firefox 16.1. open http://www.websocket.org/echo.html2. click on 'Connect'-> socket properly open Web3. click on 'Send'-> packet sent, but receaved no answer.4. click on 'Send' 3-7 times. -> Profit. Firefox receaved th
-
The "Buck" has to stop SOMEWHERE!
"First of all, I know that SCEA is a real different company but when I expereince questions there I'm not going ' ah, gosh darn it Sony Computer Entertainment Of AMerica '... I say "Frekanin Sony!" Now, this must face a society that Sony authorizes b
-
I f3 2009 installed on an XP sp3 machine and I am trying to build an executable and get the error below. I can find the error.llb and the vi in question. I opened it even without any problem. I've included the vi I'm turning into an exe file, thoug
-
HP OfficeJet Pro 8600 N911a - two-sided copies
I'm eager to take a two originals face and make a copy of both sides. When I press the ECO button it says that this option is disabled. I can't understand how to turn it on.