topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 3:41 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Yaron [ switch to compact view ]

Pages: [1]
2
Developer's Corner / Re: Set a VBS file encoding
« on: July 18, 2017, 05:16 PM »
 :up:

3
Developer's Corner / Re: Set a VBS file encoding
« on: July 18, 2017, 10:51 AM »
SendKeys() does not support Unicode.

See https://www.donation...?topic=44105.new#new for an alternative.

@wraith808,
Thanks again.

4
Developer's Corner / VBS: Select one file in a folder
« on: July 18, 2017, 10:48 AM »
Hello,

The following code selects arg1 in a Windows Explorer folder:

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("""" & WScript.Arguments(0) & """")
WScript.Sleep 400

' objShell.SendKeys("^a{F5}") ' Deslect All.

Set objShellAPP = CreateObject("Shell.Application")
On Error Resume Next ' For new unsaved files.
With objShellAPP.Windows(objShellAPP.Windows.Count - 1).document
.SelectItem .Folder.Items.Item(WScript.Arguments(1)), 17
End With

Set objShell = Nothing
Set objShellAPP = Nothing

If fileA is already selected in the folder and fileB is passed as arg1, both files are selected.

How can I have fileA deselected and only fileB selected?
The commented line
objShell.SendKeys("^a{F5}")
is a workaround, but there must be a better way.

Thank you.

5
Developer's Corner / Re: Set a VBS file encoding
« on: July 15, 2017, 04:27 PM »
I'm not really familiar with encoding. I'll post here if the "playing around" works.

Thank you. I appreciate your help.

6
Developer's Corner / Re: Set a VBS file encoding
« on: July 15, 2017, 03:11 PM »
I've changed .Charset = "utf-8" to .Charset = "_autodetect"
and then .Charset = "_autodetect" to .Charset = "Windows-1255".

Thanks again.

7
Developer's Corner / Re: Set a VBS file encoding
« on: July 15, 2017, 02:48 PM »
Hello wraith808,

Thanks for replying. I appreciate it.

I've managed to convert from ANSI to UTF-8. Trying to convert from ANSI to Windows-1255 (Hebrew) does not work.
Any idea?

Best regards.

8
Developer's Corner / Set a VBS file encoding
« on: July 15, 2017, 11:32 AM »
Hello,

I use the following code in a BAT file to open a folder and select a file in an existing Windows Explorer window (QTTabBar installed).

start "" %1

:VBSDynamicBuild
SET TempVBSFile=%temp%\~tmpSendKeysTemp.vbs

ECHO Set tSK = CreateObject("WScript.Shell") >> "%TempVBSFile%"
ECHO WScript.Sleep 200 >> "%TempVBSFile%"
ECHO tSK.SendKeys "^q%~2" >> "%TempVBSFile%"

CSCRIPT //NoLogo "%TempVBSFile%"

DEL /F /Q "%TempVBSFile%"

How can I change the temp VBS file encoding from the BAT file?

I'd appreciate your help.

9
Developer's Corner / Re: Apply changes in Registry immediately
« on: July 05, 2015, 06:04 PM »
Hi MilesAhead,

You should try. Best of luck.
The singed extensions policy is supposed to start in v40 (in about 6 weeks). I hope it won't be difficult to modify the relevant code.

Regards. 

10
Developer's Corner / Re: Apply changes in Registry immediately
« on: July 04, 2015, 06:21 PM »
Hi MilesAhead,

Thank you.

I have very little experience in development; - I wouldn't know where to start creating a nice app like "MoveIt".
With your talent, I'm sure you could contribute a lot to Firefox and Firefox add-ons. I think you would enjoy it as well.

http://forums.mozill...g/viewforum.php?f=19

I wish you the very best.

11
Developer's Corner / Re: Apply changes in Registry immediately
« on: July 04, 2015, 04:25 PM »
@MilesAhead,

Persistent as always. :) I'm truly grateful.

I think that "Components.interfaces.nsIWindowsRegKey" uses that API.

I posted the question here and Mike referred me to the SystemParametersInfo function.

So, the following code works:

Code: Javascript [Select]
  1. Components.utils.import("resource://gre/modules/ctypes.jsm");
  2. let lib = ctypes.open("user32.dll");
  3.  
  4. let fontSmooth = lib.declare("SystemParametersInfoW", ctypes.winapi_abi, ctypes.bool, ctypes.unsigned_int, ctypes.unsigned_int, ctypes.voidptr_t, ctypes.unsigned_int);
  5.  
  6. fontSmooth(0x004B, true, ctypes.voidptr_t(0), 0);   // 0x004B = SPI_SETFONTSMOOTHING. true/false = toggle font smoothing.
  7.  
  8. lib.close();

Best regards.

***
@mouser,

Thanks for replying. I really appreciate it.

Best regards.

12
Developer's Corner / Re: Apply changes in Registry immediately
« on: July 03, 2015, 06:22 PM »
Hello MilesAhead,

Thanks again. I appreciate it.

The code I use does change the value in the registry; - it doesn't apply it immediately.
Your replies are very helpful. I'll wait a bit.

Best wishes.

13
Developer's Corner / Re: Apply changes in Registry immediately
« on: July 03, 2015, 05:01 PM »
Hello my friend,

I hope you're doing well.

Thank you for this reply.
And also many thanks for "MoveIt" and "Process Counter"; - I use both frequently and really enjoy them.

I think there's a way to update the registry from a Firefox extension without using external applications.
So, I'd rather wait. Please don't consider this ungrateful. :)

Can you think of other good forums I can post this question? I'd appreciate that.

Have a great weekend.

14
Developer's Corner / Apply changes in Registry immediately
« on: July 03, 2015, 03:42 PM »
Hello,

The following code (in a Firefox extension) toggles the value of the "FontSmoothing" Registry-Key.

Code: Javascript [Select]
  1. let regFontSmooth = Components.classes["@mozilla.org/windows-registry-key;1"].createInstance(Components.interfaces.nsIWindowsRegKey);
  2. regFontSmooth.open(regFontSmooth.ROOT_KEY_CURRENT_USER, "Control Panel\\Desktop", regFontSmooth.ACCESS_ALL);
  3. regFontSmooth.writeStringValue("FontSmoothing", regFontSmooth.readStringValue("FontSmoothing") == 0 ? 2 : 0);
  4. regFontSmooth.close();

How do I apply the changes immediately (without a reboot or restarting Windows Explorer?

Thank you.

16
Post New Requests Here / Re: Command line - Some questions
« on: April 01, 2014, 09:44 PM »
Thank you. Special thanks for installing WinRar. It's really kind of you.

I'm not a developer, but I often make some small changes in Firefox extensions.
There are thousands of FF developers, and I've been wondering why the major archivers don't include the option to compress directly to XPI.

Please see this post:
https://www.donation...ex.php?topic=37601.0

I'd be grateful for any further ideas.

*

And thanks to MilesAhead for his help and for referring me to this forum.

17
Post New Requests Here / Re: Command line - Some questions
« on: April 01, 2014, 08:08 PM »
Thank you.

I'm trying to add "Compress to FileName.xpi".

19
Post New Requests Here / Command line - Some questions
« on: April 01, 2014, 06:18 PM »
I've created a batch file for zipping selected items in a folder.
(The file is placed in 'Send to').


If I use the following code:
for %%* in (.) do set CurrentFolder=%%~n* "C:\Program Files\WinRar\WinRar" a -afzip "%CurrentFolder%.xpi"

    The file name is that of the current folder (correct).
    All files are archived whether I select one file or multiple files (wrong).
    Selected folders are not archived (wrong).

If I use the following code:
set file=%~f1 "C:\Program Files\WinRar\WinRar" a -afzip "%file:~0,-4%.xpi" "%1"

    The file name is that of the file on which I right click (correct).
    Only that file is archived even if multiple files are selected (wrong).



How can I know if a single item is selected or more?
What's the condition syntax?
How can I include folders in the archive?


Thank you.

20
Post New Requests Here / Re: Add to archive "FileName.xpi"
« on: March 31, 2014, 07:38 PM »
Thanks again. I appreciate it!

That script is a good idea, but before writing to its author:
 
I've written to WinZip support and they kindly referred me to
http://kb.winzip.com/kb/entry/238/
And suggested to replace zip with xpi.

It might be somewhat ungrateful, but I'm used to WinRar. I still may purchases WinZip.

set file=%~f1
"C:\Program Files\WinRar\WinRar" a -afzip "%file:~0,-4%.xpi"

With that code in a batch file, WinRar compresses to FileName.xpi

I've got some problems with that:
1) If I select all items, folders are not included in the compression (only files).
2) I get the same result whether I select a single file or multiple files (i.e. ALL files are compressed).
2) The compressed file name is always that of the file on which I right-click -> Send To -> Batch.

If I add "%1" to the end of the second line, only the file on which I right-click is compressed.

IOW, I'd like the batch to work like the "Compress to" command.


If you are familiar with batch code, I'd be grateful for help. :)

*

I hope you're doing well.
Best wishes.

21
Post New Requests Here / Re: Add to archive "FileName.xpi"
« on: March 30, 2014, 08:08 PM »
Thank you. :)

That script might be useful.
When I need to compress to xpi, I rename the zip file. Maybe I should look for a script to rename the newly created zip file.
What do you think?

22
Post New Requests Here / Add to archive "FileName.xpi"
« on: March 26, 2014, 06:41 PM »
I use WinRar.

In Options > Settings > Integration > User defined archive extensions, I've associated XPI and JA files with the program.


I would like to add the following entries to Windows Explorer's context menu:

1) Add to archive "FileName.xpi"
2) Add to archive "FileName.ja"


I'd like the entries to appear below the default "Add to archive 'FileName.zip'", and also the compression format to be in my zip settings.


*

If you know of another Archiver with which I could achieve that, please let me know.


(Win 7, 32 bit).

Thank you.


http://www.sevenforu...ve-filename-xpi.html

Pages: [1]