Author |
Topic |
|
ivancarv.spk333
38 Posts |
Posted - 03/24/2013 : 19:33:15
|
what is the script function to switch to the Visualization and Organization of files in Explorer?
|
|
Chris
28 Posts |
Posted - 03/25/2013 : 08:36:19
|
Maybe sending hotkeys using acSendKeys: alt+v then d for details alt+v then l for list ...etc. |
|
|
ivancarv.spk333
38 Posts |
Posted - 03/25/2013 : 09:46:04
|
I wanted the script to change the options with the mouse scroll.. |
|
|
Chris
28 Posts |
Posted - 03/25/2013 : 12:05:45
|
Global Lua: explorerViewCounter = 1 ------------------------------------------
The Script for scroll up: explorerViewCounter = explorerViewCounter+1 if explorerViewCounter == 6 then explorerViewCounter = 1 end acMessageBox(explorerViewCounter,"explorerViewCounter Value",nil) ---------------------------------------------
The script for scroll down: explorerViewCounter = explorerViewCounter-1 if explorerViewCounter == 0 then explorerViewCounter = 5 end acMessageBox(explorerViewCounter,"explorerViewCounter Value",nil) -------------------------------------------------
Note that each time you scroll up, it will increase the number to max 5 then return to 1. And if scroll down will decrease to min 1 then return to 5. 5 because the view modes are 5 types: thumbnail, detail, list, tiles, and icons.
Then you can put something like: if explorerViewCounter == 1 then send for list if explorerViewCounter == 2 then send for detail if explorerViewCounter == 3 then send for thumbnail ...etc.
Good luck. Hope this helps. |
|
|
ivancarv.spk333
38 Posts |
Posted - 03/26/2013 : 03:10:34
|
Fails, an error message appears when you run the script:
[ActionScript String'''']: 26: syntax error near 'script'
Note: Still Use Windows XP |
|
|
Chris
28 Posts |
Posted - 03/26/2013 : 04:40:44
|
Put only these scripts first: On Global Lua:
explorerViewCounter = 1
On the scroll-up Lua Script:
explorerViewCounter = explorerViewCounter+1
if explorerViewCounter == 6 then
explorerViewCounter = 1
end
acMessageBox(explorerViewCounter,"explorerViewCounter Value",nil)
Note: After you put the scripts and scroll, you should get message box showing the value of "explorerViewCounter" (1-5).
Can it work? |
|
|
ivancarv.spk333
38 Posts |
Posted - 03/27/2013 : 02:25:44
|
It did not work, appears here only the messages "1", "2", "3" .... alright, I'll be fine without this function Thanks for the effort. |
|
|
Chris
28 Posts |
Posted - 03/27/2013 : 03:18:25
|
Oh yes, it's only message because I thought you only ask for the mechanism, not the full script. The message showing 1, 2,.. only to show that the mechanism works if you want to go through all the view options. Anyway, this is the full script for the scroll up:
explorerViewCounter = explorerViewCounter+1
if explorerViewCounter == 6 then
explorerViewCounter = 1
end
if explorerViewCounter == 1 then
acSendKeys("%v")
acSendKeys("{DELAY=200}h")
elseif explorerViewCounter == 2 then
acSendKeys("%v")
acSendKeys("{DELAY=200}s")
elseif explorerViewCounter == 3 then
acSendKeys("%v")
acSendKeys("{DELAY=200}n")
elseif explorerViewCounter == 4 then
acSendKeys("%v")
acSendKeys("{DELAY=200}l")
elseif explorerViewCounter == 5 then
acSendKeys("%v")
acSendKeys("{DELAY=200}d")
end
Don't forget to put below script in the Global Lua:
explorerViewCounter = 1
It's a simple script if you want to try to understand the script... The Global Lua explorerViewCounter = 1 means that you create a global variable (just think of variable as a container) with the name explorerViewCounter and set the value to 1. Global means that every script you create can read or manipulate the value of the variable.
Then in scroll-up Lua Script explorerViewCounter = explorerViewCounter+1 means that each time you scroll-up the explorerViewCounter will increase 1 in value.
if explorerViewCounter == 6 then
explorerViewCounter = 1
end Above script means that if the value of explorerViewCounter equals to 6, it will be set to 1.
In short, each time you scroll-up, the value of explorerViewCounter will increase 1. But, if the value is 6, the value will be set to 1. Therefore, you will get 1 to 5 then revert back to 1.
acSendKeys is just sending hotkeys to the active window..in your case, it is the explorer window. So, you need to have explorer window active to use this script.
Hope you learn something here. |
|
|
ivancarv.spk333
38 Posts |
Posted - 03/30/2013 : 17:26:38
|
This Time the Script worked, however I found that Alt + V has no effect on Windows XP. I think it has more chances ... |
|
|
ivancarv.spk333
38 Posts |
Posted - 04/06/2013 : 09:19:14
|
I changed the "%v" for "%x" that worked. |
|
|
|
Topic |
|
|
|