Jump to content
Macro Express Forums

cldcp00

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by cldcp00

  1. Hi The Clipboard contains C:\Desmond Music\Music Library 2018\000 Music Selected To Play WhatsApp Group\Check if already got\02 Funky Maker (Horace Andy - Funny Man).mp3 and I have entered the following expecting that it should trap anything that begins with C:\Desmond Music\ Is this not the case? If not what options do I have?
  2. Thanks Guys I will Experiments with Windows Control which i feel is best for what I am trying to do
  3. Hi I have a macro where I need to click on a button within Windows File Explorer that does not have a shortCut assigned. What is the best way to do this?
  4. I am probably at fault for not explaining my requirements properly, but the macro once working WILL save me a lot of time, and as they say time is money. I will research successive selections and experiment. Thanks again for all your Input.
  5. Correct Cory Would have saved a lot of pain with the quotes
  6. Thanks Terrypin, Sorry to be a pain. How would the Repeat and End Repeat loop be controlled i.e how would it know how many items have been copied to the clipboard. Say 3 items in Windows File Explorer has been selected do I need to use something like Clipboard Append Text then loop the code to read each line in the file. Is this the right approach?
  7. Hi Cory, Below is the MEP Code which passes two values to the External VBScript Variables %FullFilename% %Destination% // PURPOSE OF MACRO Copy the seleced file to another existing user-selectable folder. Clipboard Empty Text Type (Simulate Keystrokes): <F2> // Edit mode. Delay: 0.2 seconds // Select all. (Iincluding extension, which I found necessary in Win 10.) Or use @acantor's equally effective method. Text Type (Simulate Keystrokes): <CONTROL>a Delay: 0.2 seconds Clipboard Copy Delay: 0.2 seconds Variable Set String %tFilename% from the clipboard contents Text Type (Simulate Keystrokes): <ESC> // Close edit mode Delay: 0.1 seconds // Select address of current folder. Text Type (Simulate Keystrokes): <ALT>d Delay: 0.1 seconds Clipboard Copy Delay: 0.1 seconds Variable Set String %tFolder% from the clipboard contents Text Type (Simulate Keystrokes): <ESC> // Close edit mode Delay: 0.1 seconds // Now re-assemble the original full filename and path. Variable Modify String %tFullFilename%: Append Text String Variable (%tFolder%) Variable Modify String %tFullFilename%: Append Text (\) Variable Modify String %tFullFilename%: Append Text String Variable (%tFilename%) Variable Modify String: Save %tFullFilename% to the clipboard Delay: 0.1 seconds Variable Set String %tDestination% to "C:\Desmond Music\New Music Library 2018\Classical" External Script: VBScript Text Box Display: Results The External VBscript is called (See code below) Things to note The %Console% variable specified in the save console output to Box is the means by which and output form the VBscript is passed back to the host MEP script. So Wscript.Echo has passed "File Copied Successfully" to the the MEP script using Console. Then the last thing I do is display %Console% using Text Box Warning The thing that caught me out was the quotes "%Destination%" around the passed variables, I did not noticed that they were needed, and it just will not work without them. As i have already said this has something to do with the way MEP passings vales to the External Script. I am a newbie so sorry if I have not used the correct terms but I hopes it helps
  8. Hi Cory, I am away from that PC at the moment, back home tomorrow evening. I will try and explain tomorrow what I did to get it working, quite straight forward, my issue was I had left off some needed quotes" " around the variables. This has something to do with how MEP passes the value to the VBscript Regards
  9. Sorry I cannot seem to find it again. I cannot remember the search term that i used.
  10. Hi Terry, Thanks to your help I have now got everything working perfectly. Currently the macro only works for a single item. Could it be amended to also work if multiple files are selected? Regards Desmond
  11. Hi terrypin, Sorry I missed this post. Yes I got the script working and growing in experience with the language. Thanks again for all your help
  12. Hi Cory Managed to get it sorted. Found one of your old post and figured it out. Thanks for all your old posts, much appreciated
  13. Hi Cory, Sorry to be a pain. I am having a bit of trouble passing the value of two Variables in my my macro to the VBScript. It works fine when I hard code but not with the variables. I have two variables in my macro that needs to be passed to the VBscript %tFullFilename% %tDestination% I have read the information you suggested (below) but still do not fully understand. If I set "%tDestination%" to %MacExpString% , how do I pass the second Variable %tFullFilename% Variable Set String %MacExpString% to "%tDestination%" And in the External Script must the Variable be called vbsString? Have you got and example code? To pass Macro Express Pro variables to your VB Script do this:In your macro use the Variable Set String command Variable Set String %MacExpString% to "Pass this to VBScript" Then include this line in the External Script command: vbsString = "%MacExpString%"
  14. That Exactly what I am trying. Can you explain why it will not work? The clipboard copies this C:\Desmond Music\Music Library 2018\000 Music Selected To Play WhatsApp Group\Bad Tunes\02 - Brethren & Sistren.mp3
  15. I cannot for the life of me see why this simple code does not work? The Clipboard Copy works but for some reason the Variable Set String does not Clipboard Copy Delay: 1 seconds Variable Set String %tFilename% from the clipboard contents MessageBox: Test Or <CLIPBOARD COPY/> <DELAY Flags="\x01" Time="1"/> <VARIABLE SET STRING Option="\x02" Destination="%tFilename%" NoEmbeddedVars="FALSE"/> <MESSAGEBOX Caption="Test" Message="%tFilename%" Icon="0"/> I seem to make good progress and then something simple baffles me.
  16. Hi I am toying with the idea of calling a VBScript to handle Copying and Writing to a text file as it appears to be more robust. If I needed to pass the full path name and receive back conformation of Successful run, How this could be done? Thanks for any advise This is the basic code I am proposing to call How would pass the replace the Copyfile hard coded values with variables File to be copied C:\Desmond Music\Music Library 2018\000 Music Selected To Play WhatsApp Group\BB Seaton\05 - BB Seaton - Thin Line Between Love & Hate.mp3 Folder to copy to C:\Desmond Music\New Music Library 2018\Jazz\ Option Explicit Dim fso Dim fso1 Dim filename vbsString = "%MacExpString%" Set fso = CreateObject("Scripting.FileSystemObject") Set fso1 = CreateObject("Scripting.FileSystemObject") Set filename = fso1.OpenTextFile("C:\Users\desmo\Desktop\Audit Trail.txt", 8) 'To Copy a file fso.CopyFile "C:\Desmond Music\Music Library 2018\000 Music Selected To Play WhatsApp Group\BB Seaton\05 - BB Seaton - Thin Line Between Love & Hate.mp3", "C:\Desmond Music\New Music Library 2018\Jazz\" filename.WriteLine "C:\Desmond Music\New Music Library 2018\Jazz\" filename.Close
  17. Hi Terrypin, Thanks for all your time. I have run your script and it appears to have an issue in these lines. Text Type (Simulate Keystrokes): <ALT>d Clipboard Copy When I debug it %Destination% has the Value "Name Value" in it. What's very strange is that when I perform the task manually it copies the correct folder path to the clipboard C:\Desmond Music\New Music Library 2018\Jazz See debug info below
  18. Just a quick question. Is there a way to get the macro to capture the selected file name and not having to manually copy the filename to the clipboard.
  19. Hi Terrypin, Thanks for your reply. Maybe this will help. I will copy the path and filename/s to be copied to the clipboard. Then the proposed macro will pick this value up and then ask me where I want the file to be copied too Once I select the folder the macro will copy the file to that Folder This is the basics of the macro. Hope this helps
  20. Thanks Guys I will try and amend the code as suggested and let you know how I got on. Hopefully I can make the code more easier to read. Thanks again.
  21. Hi There, I am looking for help to put together a macro that can do the following. I will have a Windows 10 File Explorer Windows open and have selected various files (these files will be the result of a search, so will be located in different Folders) So maybe Copying them to the Clipboard 1. The Macro will display a list of predefined Target Directories. 2. On clicking on one of the them it will move the file/files (details of which will be in the clipboard) to the selected Directory. I have spent a great deal of time trying to get this to work and to be honest given up. This is a last ditch effort to be pointed in the right direction Below is my attempt at writing the macro Any help will be most appreciated. <CLIPBOARD COPY/> <COMMENT Value="Extract the FILENAME from full path & filename."/> <VARIABLE SET STRING Option="\x02" Destination="%Input%" NoEmbeddedVars="FALSE"/> <VARIABLE SET INTEGER Option="\x0D" Destination="%Length%" Text_Variable="%Input%"/> <REPEAT START Start="%Length%" Step="-1" Count="%Length%" Save="TRUE" Variable="%Index%"/> <VARIABLE MODIFY STRING Option="\x09" Destination="%Char%" Variable="%Input%" Start="%Index%" Count="1" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%Output%" Variable="%Char%" NoEmbeddedVars="FALSE"/> <END REPEAT/> <VARIABLE SET INTEGER Option="\x0E" Destination="%nPosReversed%" Text_Variable="%Output%" Text="\\" Ignore_Case="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x01" Destination="%nPos%" Value1="%Length%" Value2="%nPosReversed%"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%nPos%"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%Input%" Start="1" Count="%nPos%"/> <TEXT BOX DISPLAY Title="Result" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %Input%\r\n\\par \r\n\\par \r\n\\par \r\n\\par \r\n\\par \r\n\\par \r\n\\par \\f1 \r\n\\par \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE" _COMMENT="Disable this when satisfied."/> <COMMENT Value="Proceed with rest of macro."/> <OPEN FOLDER Path="C:\\Users\\desmo\\Desktop\\Music Library 2018\\Favourite"/> <VARIABLE SET STRING Option="\x00" Destination="%T4%" Value="C:\\Users\\desmo\\Desktop\\Music Library 2018\\Favourite\\" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%T4%" Value="%T4%%Input%" NoEmbeddedVars="FALSE"/> <WAIT FOR WINDOW TITLE Title="Favourite" Partial="FALSE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="20"/> <CLIPBOARD PASTE/> <DELAY Flags="\x01" Time="1"/> <WINDOW CLOSE Option="\x01" Title="Favourite" Partial="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <DATE/TIME Format="dd/MM/yyyy HH:MM" Flags="\xB0" Date="25/12/2018 22:29:25" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="0" Variable="%T3%" IsDateVar="FALSE"/> <VARIABLE SET STRING Option="\x02" Destination="%T1%" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%T2%" Value=" - Moved to Favourite" NoEmbeddedVars="FALSE"/> <VARIABLE SET STRING Option="\x00" Destination="%T1%" Value="%T1% %T2% %T3%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x10" Destination="%T1%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x00" Destination="%T4%"/> <IF FILE EXISTS File="%T4%" Search_Path="FALSE"/> <CLIPBOARD APPEND TEXT Filename="C:\\Users\\desmo\\Desktop\\Music Sorting Log.txt" Prompt="FALSE"/> <TEXT BOX DISPLAY Title="File Copied Sucessfully" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs24 File has been moved to \\b Favourite \\b0 Folder\\b \r\n\\par \\b0\\f1\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x01" Delay="3"/> <DELAY Flags="\x01" Time="3"/> <ELSE/> <TEXT BOX DISPLAY Title="File Copy Failed" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs24 The file copy \\b Failed \\b0 please check and retry\\b \r\n\\par \\b0\\f1\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x01" Delay="3"/> <DELAY Flags="\x01" Time="3"/> <END IF/>
  22. Hi There, Is it possible to have a macro that will use the will search the pc for a filename which is in the clipboard and if found open the containing folder? Thanks in advance for any help
×
×
  • Create New...