Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/15/2017 in all areas

  1. Dog ate your helpfile? (© Jos)
    1 point
  2. You have your Return statement in the GET_LANG function in the wrong place, returning the wrong thing. You don't need a Return in that function anyway, because you're not reading what you're returning.
    1 point
  3. You can use something like: #include <Array.au3> #include <Excel.au3> Global $oExcel = _Excel_Open(False, False, False, False, True) Global Const $sSpreadsheet = @ScriptDir & '\data.xlsx' Global $oSpreadsheet = _Excel_BookOpen($oExcel, $sSpreadsheet, True, False) Global $aSpreadsheet = _Excel_RangeRead($oSpreadsheet) _ArrayDisplay($aSpreadsheet)
    1 point
  4. That has been a design choice in the past, but understand this could be confusing for people programming in other languages. When using au3check, to check the source code, with parameter "-w 4" you will get a report about this: test.au3"(12,7) : warning: 'Local' specifier in global scope. Local $bar ~~~~~~^ Jos
    1 point
  5. Hello. how do you add your script to the Directory background context menu ? I think is better to pass the current directory path as commanline parameter. so you can do something like this: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\TestApp] @="Test Script" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\TestApp\command] @="\"C:\\Users\\MyUserName\\Desktop\\MyAppp.exe\" \"%V\"" Then you can handle this way Local $sWorkingDir=$CmdLine[1] Local $aFileList = _FileListToArrayRec($sWorkingDir & "\", "*", 0 +8, 1, 1, 1) Saludos
    1 point
  6. Slightly modified version of mLipoks version. Disables/Enables the conversion message, not to be confused with _Word_DocOpen conversion parameter Need to specify $wdFormatDocumentDefault otherwise it just saves it as something like word.doc rather than the name you specify. #include <Word.au3> ; Create application object Local $oWord = _Word_Create() If @error Then Exit ;~ Disable Message: Word will now convert your PDF to an editable Word document. This may take a while. The resulting Word document will be optimized to allow you to edit the text, so it might not look exactly like the original PDF, especially if the original file contained lots of graphics. RegWrite("HKCU\SOFTWARE\Microsoft\Office\15.0\Word\Options", "DisableConvertPdfWarning", "REG_DWORD", 1) ; Open the test document Local $bDoc = True, $oDoc = _Word_DocOpen($oWord, @ScriptDir & "\Filename.pdf") If @error Then $bDoc = False ;~ Enable Message: Word will now convert your PDF to an editable Word document. This may take a while. The resulting Word document will be optimized to allow you to edit the text, so it might not look exactly like the original PDF, especially if the original file contained lots of graphics. RegWrite("HKCU\SOFTWARE\Microsoft\Office\15.0\Word\Options", "DisableConvertPdfWarning", "REG_DWORD", 0) If $bDoc = False Then Exit ; ***************************************************************************** ; Save the document as Filename.docx ; ***************************************************************************** _Word_DocSaveAs($oDoc, @ScriptDir & "\Filename.docx", $WdFormatDocumentDefault) If @error Then Exit _Word_DocClose($oDoc)
    1 point
  7. Something like this: #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <Word.au3> ; Create application object Local $oWord = _Word_Create() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocSaveAs Example", _ "Error creating a new Word application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; Open the test document Local $oDoc = _Word_DocOpen($oWord, @ScriptDir & "\Example.pdf") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocSaveAs Example", _ "Error opening 'Example.pdf'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Word_DocSaveAs($oDoc, @ScriptDir & "\_Word_Test2.doc") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocSaveAs Example", _ "Error saving the Word document." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocSaveAs Example", "Document successfully saved as '" & _ @ScriptDir & "\_Word_Test2.doc'.") Remark: not tested.
    1 point
  8. Subz

    WinExists problem

    Or you could try running msiexec.exe /x {GUID} /qb /norestart or msiexec.exe /x "Filename.msi" /qb /norestart, assuming this is a Windows Installer i.e. an Msi based installer
    1 point
  9. Instead of automating the GUI, use the command line options : RunWait(@SystemDir & '\msiexec.exe /i "' & @ScriptDir & '\installer.exe" /qb', @SystemDir) Edit : your problem is that you used ShellExecuteWait (it's a blocking function) : try with ShellExecute instead
    1 point
  10. czardas

    mus++

    mus++ for non-musicians It is important to listen to all the examples in this tutorial to understand what is happening. The first thing you need to know is that there are seven letters used to name musical notes A, B, C, D, E, F and G. All note names must be typed using upper case. Let's start with the simplest case. The following note is called A. A This note has a default pitch of 440 Hz and will sound for exactly 600 ms. There are several ways to prolong the duration of our note. Prefixing a plus sign produces a note which lasts twice as long (1200 ms). +A Alternatively a minus sign will shorten the note by half (300 ms). -A All notes inherit the duration of the previous note, so the following sequence will produce four notes lasting 600 ms followed by four faster notes at 300 ms: A A A A -A A A A To return to the default duration you need to use an apostrophe. A A A A -A A A A ;A A A A The symbols used to alter note durations are as follows: o = 2400 ms + = 1200 ms ; = 600 ms default ... quarter note - = 300 ms ~ = 150 ms = 75 ms ? = 37.5 ms In the above list, each note is half the duration of the previous. The values for duration are true when the music is played at the default speed of 100 bpm (100 quarter notes occuring in 1 minute). More about this later. Now lets look at pitch. The following sequence represents a scale (all notes must be separated by at least one space): A B C D E F G A When listening to the scale above, you will notice that the note sequence does not always rise in pitch. To make the notes continue ascending, it is necessary to go up to the next octave. To do this you simply place a single quote after the note name. Each new octave starts with the note C. A B C' D E F G A When there are no quotes attached to a note, it will inherit the octave of the previously encountered note. A quote placed before a note sets the octave range below the default range. G F E D C 'B A To return to the default octave range, use a single quote on both sides of the note name: 'B' as shown below. C D E F G A B +C' ;'B' A G F E D oC In music a note can be raised by a semitone using a sharp (hash sign #): A B C' D E F# G# +A Or lowered by a semitone using the flat symbol (lower case b ). E D 'B Bb G oE Sharps and flats are also attributes inherited from a previous note with the same letter name. In the following sequence all notes containing F will be sharpened. D E F# +G ;F E D C 'B A oG To cancel a sharp or flat you can use a natural sign (lower case z) D E F# +G ;Fz E D C 'B A oG When attached to a note these three symbols (# b z) are called accidentals. Accidentals are cancelled after a bar line - vertical bar |. More about bar lines in the next tutorial. Do not place a single quote between a note and an accidental. 'E'b is incorrect - it should be written 'Eb' Try adding and changing the symbols in the examples and create your own examples using these basic features and you'll quickly be writing mus++. Examples from the above tutorial: _MusPlusPlus("A") Sleep(2000) _MusPlusPlus("+A") Sleep(2000) _MusPlusPlus("-A") Sleep(2000) _MusPlusPlus("A A A A -A A A A") Sleep(2000) _MusPlusPlus("A A A A -A A A A ;A A A A") Sleep(2000) _MusPlusPlus("A B C D E F G A") Sleep(2000) _MusPlusPlus("A B C' D E F G A") Sleep(2000) _MusPlusPlus("G F E D C 'B A") Sleep(2000) _MusPlusPlus("C D E F G A B +C' ;'B' A G F E D oC") Sleep(2000) _MusPlusPlus("A B C' D E F# G# +A") Sleep(2000) _MusPlusPlus("E D 'B Bb G oE") Sleep(2000) _MusPlusPlus("D E F# +G ;F E D C 'B A oG") Sleep(2000) _MusPlusPlus("D E F# +G ;Fz E D C 'B A oG") Sleep(2000)
    1 point
  11. ok, here ya go. Use the vba recorder to learn a bit as you go. #Include <Excel.au3> $oExcel = _ExcelBookNew(1) _ExcelSheetAddNew($oExcel, "Temp") _ExcelSheetActivate($oExcel, "Temp") _ExcelWriteCell($oExcel, 1, 1, 1) _ExcelWriteCell($oExcel, 2, 1, 2) _ExcelWriteCell($oExcel, "=RC[-2]+RC[-1]", 1, 3) $oExcel.ActiveSheet.Range("C1" ).Activate $Row = $oExcel.ActiveCell.Row $Column = $oExcel.ActiveCell.Column $Formula = $oExcel.ActiveCell.FormulaR1C1 Msgbox(0,"R1C1", $Row & ", " & $Column & ", " & $Formula)
    1 point
×
×
  • Create New...