TehWhale Posted September 29, 2008 Posted September 29, 2008 (edited) So, basically im tring to make a Standalone chrome.exe, so i have a _FileListToArray array of files, and i want to output like this, for example, it would be: FileInstall("Chrome\locales\vi.dll", @TempDir&"\Chrome\locales\vi.dll") Using filewrite and such, so in the script, it'll be like: _FileListToArray(@ScriptDir&"\Chome\locales\", "*.*", 1) Then, I know im using locales folder, so For $i=1 to $FileArray[0] FileWrite(@ScriptDir&"\blah.au3", "FileInstall('Chrome\locales\'& $FileArray[0]&', @TempDir&'\'&"&$FileArray[$i]) Next And that's always giving me errors... Just to clarify, I want the variable in the script, the file, but i want @TempDir written, not MY temporoary directory. Edited September 29, 2008 by SwiftBurns
Rick Posted September 29, 2008 Posted September 29, 2008 (edited) FileWrite(@ScriptDir&"\blah.au3", "FileInstall('Chrome\locales\" & $FileArray[0] & "', @TempDir & "\" & $FileArray[$i] & "')") Edited September 29, 2008 by Rick Who needs puzzles when we have AutoIt!!
dbzfanatic Posted September 29, 2008 Posted September 29, 2008 (edited) You can't use a variable in the source. Ever. End of story. Edited September 29, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
Rick Posted September 29, 2008 Posted September 29, 2008 You can't use a variable in the source. Ever. End of story.but it wont be a variable when written Who needs puzzles when we have AutoIt!!
BrettF Posted September 29, 2008 Posted September 29, 2008 (edited) You can't use a variable in the source. Ever. End of story.Please explain EDIT:He means in file install. Look it up in the helpfile peeps. >_< Edited September 29, 2008 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
dbzfanatic Posted September 29, 2008 Posted September 29, 2008 (edited) Yes it will. Look in the helpfile. It specifically states you can't use a variable for the source so don't even try. Even if you String() the expression it's still containing a variable and thus won't work. FileInstall -------------------------------------------------------------------------------- Include and install a file with the compiled script. FileInstall ( "source", "dest" [, flag] ) Parameters source The source path of the file to compile. This must be a literal string; it cannot be a variable. Edit: Added helpfile line. Edited September 29, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
PsaltyDS Posted September 29, 2008 Posted September 29, 2008 You can't use a variable in the source. Ever. End of story. He's not. His script is creating another script where the variable will already be parsed into a literal string when written into the FileInstall() line of the new script. To generate the formatted text and test it, try this: ; Simulated output of _FileListToArray() Global $FileArray[3] = [2, "Test1.txt", "Test2.txt"] ; Loop to output generated FileInstall() script lines For $n = 1 To $FileArray[0] ; Note double backslashes (see help file under StringFormat() $sString = StringFormat("FileInstall('Chrome\\locales\\%s', @TempDir & '\\%s')", $FileArray[$n], $FileArray[$n]) ConsoleWrite($sString & @LF) Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
dbzfanatic Posted September 29, 2008 Posted September 29, 2008 Ooooo sorry misread ^^;;. Haven't had enough caffine today >.> so my apologies. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
TehWhale Posted September 29, 2008 Author Posted September 29, 2008 Sweet guys, thanks! I think I finally got double quotes down. I will now present my Chrome Standalone Launcher in the Google Chrome thread!
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