Possible to save a file in AutoHotKey script? - copy

i want to save a .png file in to a AutoHotKey script, so that when i run the script it make the .png file.
i tryed to open the .png with notepad++ and copy the text in to a FileAppend command but there are just to many """ and "%" characters

I havent tested (1) and (2), but here are three different approaches:
modifying AutoHotkeySC.bin with a third-party tool like ressource hacker
building a .dll which you then might access via ahk
pack the complete file into your script and start its creation upon function calling. I saved this guy's V2.3 script up to pastebin. Works perfectly fine for me.
regards

Related

Can I use Powershell to copy text from another window?

I have OneDrive files which I can access through Microsoft Word or the browser, but not via a script. I need to pass the contents of one of these files as a variable for something later down the line in my script.
Googling this gives me lots of links explaining how to copy something from the Powershell window and paste it, which isn't what I want to do.
I need Powershell to open a Microsoft Word file, copy the text inside the file, and save the result as a text file. Is there any way to do that in Windows 10 with Powershell 5? I can't install any software.

"Save as" an open file from Command Line

I have a large folder of DWG files and want to convert them to DXF files, using Solid Edge. After opening the documents, is it possible to "Save As" from the command line or powershell?
Is this a program by program line of code or is it universal for all programs?
So if I wanted to save a .docx document open in Microsoft Word as a .pdf (for want of a better example) can I use that same line of code?
Any help appreciated...
Well since you want to convert from one Autocad format to another, you could do it using Autocad's command line.
https://knowledge.autodesk.com/support/autocad/downloads/caas/downloads/content/autodesk-customization-conversion-tools.html?_ga=2.88877275.1703552679.1574826072-7420195.1574826072
This does require you writing all of the scripting of course.
Alternatively, there is this handy scripted mass converter someone wrote using lisp and they wrote a custom script executor wrapper thingy but their scripting supposedly requires the full version of autocat (at least version 2010 to accomplish this.)
https://www.cadtutor.net/forum/topic/51941-autocad-mass-convert-dwg-to-dxf-batch-convert-dwg-to-dxf-mas-dwg-convert/
That said the official AutocCAD conversion command-line utilities are also going to use LISP scripting, so you might want to just take the second script, and work through it manually testing against the normal AutoCAD utilities until you can get it working for your needs to sort of jump start you.
If you do that I would suggest re-posting with tags for LISP and AutoCAD and give them a sample of what you have got if you end up going the official tools and your own or jump-started script route.
Hope that will be helpful to you and others in the future! :)
As commented beneath my question,
No, it would not be universal
So, no, there is no way of using a single command "save as" on every single program, and as Solid Edge doesn't have a command line API, that I know of, I would have to write a program for it.

after converting powershell script to .exe listbox index is not working

I have created a script for list the names in the listbox which is given as input in the textbox. It works fine while am running in the Powershell ISE. But after i did converting to .exe files now if add any input via textbox the same which is supposed to be displayed in the listbox is not happenning.
Anyone could help on this?
I did converting process by using PS2EXE application and its method.
A a sample code snippet is required for better solutions.
The PS2EXE does not provide a standalone-independent file that can be run without Powershell, because the tool in itself is a PowerShell script which does the in-memory compilation and generates the EXE file.
P.S: There is also a chance that the functionality of such EXE files may be impacted as well.
You can look up this link for more information :
Microsoft-Technet- PS2EXE

Error on a .exe that was running perfectly before being compiled

guys,
I just finished a particular code in MATLAB R2014a that reads and write into multiple text files and saves an image inside the same folder of the script. The script runs perfectly, but the compilation executable does not, so I believe that it has something to do with the PATH that the executable is trying to use to run, I don't really know.
The error was the folllowing:
That's the second read function in the code that tries to read a file and it's possible to see that the code was already successful doing a read/write operation, since a .txt is created.
Just to keep it simple, I didn't use any global paths to the files and tried to keep them inside of the script and executable folder.
I don't have a lot of experience compiling stuff, so I just used deploytool and hit run to test it, so I would love to hear some insights about the possible cause of the problem.
Thank you in advance for the help!
MATLAB doesn't include every file on your PATH when it compiles. It tries to detect additional files that may be accessed when running the code in your application's main file, and include those in the compilation, but it isn't always 100% successful (I'm not sure exactly what conditions it's unable to detect).
After you have run the deploytool once, the full list of files it has detected in this way will be listed under Files required for your application to run. You can add files to this list (whether or not your project has already been compiled) using the "+" icon in the corner of that section.

Windows: Execute Batch File for a Custom Context Menu Item

I am looking to add a new item in a right click context menu for a certain file type. I suppose it would be easiest to run a batch file with the full path of the file as an argument. I need to rename the file, unzip it, then rezip it, then rename it. I suppose winzip command line would be appropriate tool to help with that, unless someone else has a suggestion.
My questions are:
- How can I add a custom context menu item based on file type
- How can I pass the file name as an argument to the batch file from the context menu
- Finally this may go out to 2-3 people, and it might be easier to simply have an installer that sets this up for them. Anyone know of any free installers that could do this?
Some details about why I am trying to do this:
I have a tool that is zipping things correctly, the program that is reading the zip files is not unzipping to standards it seems. It unzips in winzip legacy mode or something. Rather than fix a working program/investing time or attempt to do some ultra-fancy, crazy fix on a linux server for zipping into winzip legacy format a workaround seemed appropriate for now. These processes only really occur internally, but they are still painful/annoying to do.
7zip is free, you might want to use that if you need to bundle the zip utility
Customizing a Shortcut Menu Using Static Verbs
%1 in the command string in the registry is replaced with the filename
Inno Setup, NSIS or WiX