FLASHCODER1 Posted July 22, 2014 Posted July 22, 2014 Hi, I have this code (http://pastebin.com/5fB5KrvK) and I'd like get (*filter) only prefs.js filename with full your path without use _ArrayDisplay function, something like: $prefs = @AppDataDir&"MozillaFirefoxProfilese23e2.defaultprefs.js" and after make changes in this specific file as: If FileExists($prefs) Then ;make my changes here EndIf Can you help me, please? Thank in advance!
Richard Robertson Posted July 22, 2014 Posted July 22, 2014 $Path = @AppDataDir & "\Mozilla\Firefox\Profiles" $Array = _RecFileListToArray($Path, "prefs.js", 0, 1, 0) $Array will contain a list of prefs.js files.
FLASHCODER1 Posted July 22, 2014 Author Posted July 22, 2014 (edited) $Path = @AppDataDir & "\Mozilla\Firefox\Profiles" $Array = _RecFileListToArray($Path, "prefs.js", 0, 1, 0) $Array will contain a list of prefs.js files. OK Richard, Thanks. I understood. Then how I do for search the string (prefs.js) into $Array variable and after test in FileExists function? Some idea? Edited July 22, 2014 by FLASHCODER1
careca Posted July 22, 2014 Posted July 22, 2014 Yes, a For loop, with stringinstr. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
FLASHCODER1 Posted July 22, 2014 Author Posted July 22, 2014 (edited) Yes, a For loop, with stringinstr. I want something like this: MsgBox(0,"",$Path&$ArrayPrefs) ;Return as : C:UsersGREATEST VIEWAppDataRoamingMozillaFirefoxProfileszxl43z7i.defaultprefs.js and then make changes in prefs file like this: If FileExists($Path&$ArrayPrefs) Then ;manipulate prefs file here EndIf Edited July 22, 2014 by FLASHCODER1
Solution careca Posted July 22, 2014 Solution Posted July 22, 2014 (edited) Like this? #include "RecFileListToArray.au3" $Path = @AppDataDir & "\Mozilla\Firefox\Profiles\" $Array = _RecFileListToArray($Path, "prefs.js", 1, 1, 0, 2) For $i = 1 To $Array[0] MsgBox(64, 'Array nº'&$i,$Array[$i]) ConsoleWrite('Array nº'&$i&' = '&$Array[$i] &@CRLF) $OpenHDL = FileOpen($Array[$i]) ;Do stuff FileClose($OpenHDL) Next Edited July 22, 2014 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
FLASHCODER1 Posted July 22, 2014 Author Posted July 22, 2014 I see you want, but what have you done so far? Previous post gives you the path to the file, what did you try after that? I tried, but return nothing, only in _ArrayDisplay function Could give me a example? Thank
careca Posted July 22, 2014 Posted July 22, 2014 Edited the post, check again. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
FLASHCODER1 Posted July 22, 2014 Author Posted July 22, 2014 Edited the post, check again. That's it @careca! you got Thank you very very much guy!
guinness Posted July 22, 2014 Posted July 22, 2014 That function is included in AutoIt, but is _FileListToArrayRec(). UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
FLASHCODER1 Posted July 22, 2014 Author Posted July 22, 2014 That function is included in AutoIt, but is _FileListToArrayRec(). OK @guinness!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now