May u help me a little bit here?
lets say that you have 2 folders original and shortcutoriginal . both folders have files with same name but not necessary all of them are the same.
.can you please make a script in autohotkey like input directory ,output directory to Redirect files from input to output pathfile.
so when i press file 0043 in shortcutoriginal run 0043 of original
file Redirection (request)
Re: file Redirection (request)
So you want that when opening(double clicking) picture ‘0043’ in the ‘Shortcutoriginal’ folder, Autohotkey opens the ‘0043’ in the ‘Original’ folder instead?
Re: file Redirection (request)
u know English is not my native language.i try to use google translate to express what i want.
i want a program where i have 2 empty paths . when i put 2 folders in paths the input be like a shortcut of the other
i want a program where i have 2 empty paths . when i put 2 folders in paths the input be like a shortcut of the other
Re: file Redirection (request)
yes i want a program like that you describe
Re: file Redirection (request)
sorry again DyaTactic how difficult do u believe that it is ?
how can i begin with?
what do u suggest?
how can i begin with?
what do u suggest?
Re: file Redirection (request)
The window you show is the most time consuming I think.
Do you want to write it yourself or just have the code and see if it is what you want?
I would start by making a hotkey that does this instead of using the doubleclick event. This means that double clicking will cause to open the shortcut file and say ‘Ctrl + O’ opens the Original file.
Also I will use the clipboard of Windows (i.e. Ctrl + C hotkey) to get the filename of the selected file. This means when you copied something but did not paste it yet, this program will make that copy 'forgotten'.
Do you want to write it yourself or just have the code and see if it is what you want?
I would start by making a hotkey that does this instead of using the doubleclick event. This means that double clicking will cause to open the shortcut file and say ‘Ctrl + O’ opens the Original file.
Also I will use the clipboard of Windows (i.e. Ctrl + C hotkey) to get the filename of the selected file. This means when you copied something but did not paste it yet, this program will make that copy 'forgotten'.
Re: file Redirection (request)
This, whithout the buttons is 15 min work.
Re: file Redirection (request)
just have the code and see if it is what i want
when you say without buttons you mean without Browse right? only the pathfile
when you say without buttons you mean without Browse right? only the pathfile
Re: file Redirection (request)
The filepath should then be entered in the script. This can always be extended with a browse function.
Ill start writing right away.
Ill start writing right away.
Re: file Redirection (request)
This is working on my machine now. Make sure the filepath after ‘OriginalFolder = ’ is correct and the name ShortcutOriginal after ‘#IfWinActive, ’ is correct, dont put the full path here.
Let me know how this works.
Code: Select all
#SingleInstance Force
OriginalFolder = C:\Experiment\Original
;ShortcutFolder = C:\Experiment\ShortcutOriginal
#IfWinActive, ShortcutOriginal ahk_exe Explorer.exe
^o:: ; Press Ctrl + O to open the original picture.
SEND, ^c ; Copy the picture's filepath.
StringGetPos, FirstBackSlashPos, Clipboard, \, R
StringRight, FileName, Clipboard, % StrLen(Clipboard) - FirstBackSlashPos
Run, % OriginalFolder . FileName
Return
#IfWinActive
Re: file Redirection (request)
sorry again my English must be bad enough .
can you make this with this paths
D:\ebookscanner\17-7-21\teckthought\experiment\original
D:\ebookscanner\17-7-21\teckthought\experiment\shortcutsoriginal
can you make this with this paths
D:\ebookscanner\17-7-21\teckthought\experiment\original
D:\ebookscanner\17-7-21\teckthought\experiment\shortcutsoriginal
Re: file Redirection (request)
"the hotkey ^O will not be active because it does not exist in the current keyboard layout"
Re: file Redirection (request)
I changed the hotkey to Ctrl + 0 (its a zero now). This can be changed to anykey desired.
Let me know if this works.
Let me know if this works.
Code: Select all
#SingleInstance Force
OriginalFolder = D:\ebookscanner\17-7-21\teckthought\experiment\original
;ShortcutFolder = D:\ebookscanner\17-7-21\teckthought\experiment\shortcutsoriginal ; This line is obsolete.
#IfWinActive, shortcutsoriginal ahk_exe Explorer.exe
^0:: ; Press Ctrl + 0 to open the original picture.
SEND, ^c ; Copy the picture's filepath.
StringGetPos, FirstBackSlashPos, Clipboard, \, R
StringRight, FileName, Clipboard, % StrLen(Clipboard) - FirstBackSlashPos
Run, % OriginalFolder . FileName
Return
#IfWinActive
Re: file Redirection (request)
dude thanks for your patience.The script work perfect. if u ever wanna learn how to scan books with camera or your mobile phone and then read them on an ebookreader .tell me
Re: file Redirection (request)
something more is it possible when i delete a file from the original folder autodelete and the file from the shortcut?
Re: file Redirection (request)
Ill put everything in one script.
The WinTitle's seems to be case sensitive but it should be good now. Let me know.
The feature you are making sounds very useful. Ill remember your offer.
Code: Select all
OriginalFolder = D:\ebookscanner\17-7-21\teckthought\experiment\original
ShortcutFolder = D:\ebookscanner\17-7-21\teckthought\experiment\shortcutsoriginal
Return
; End of the autoexecute section.
#IfWinActive, shortcutsoriginal ahk_exe Explorer.exe
^0:: ; Press Ctrl + 0 to open the original picture.
FirstBackSlashPos := 0
SEND, ^c ; Copy the picture's filepath.
StringGetPos, FirstBackSlashPos, Clipboard, \, R ; Get the position of the first right side backslash.
StringRight, FileName, Clipboard, % StrLen(Clipboard) - FirstBackSlashPos ; Get the characters on the right side of this backslash (including the backslash).
Run, % OriginalFolder . FileName ; Open the Original file.
Return
; ‘Original’ in this WinTitle seems to be casesensitive.
#IfWinActive, original ahk_exe Explorer.exe
$Delete::
FirstBackSlashPos := 0
SEND, ^c ; Copy the selected file.
StringGetPos, FirstBackSlashPos, Clipboard, \, R ; Get the position of the first right side backslash.
StringRight, FileName, Clipboard, % StrLen(Clipboard) - FirstBackSlashPos ; Get the characters on the right side of this backslash (including the backslash).
MsgBox, 4, Delete shortcut?, Do you want to delete the shortcut (%ShortcutFolder%%FileName%) and the original file?
IfMsgBox, Yes
{
FileDelete, % ShortcutFolder . FileName ; Delete the shortcut file.
SEND, {Delete} ; Command Windows to delete the selected file.
WinWaitActive, ahk_class #32770 ahk_exe explorer.exe, , 2
If ErrorLevel
Return
SEND, {Enter} ; Dismiss the MsgBox from Windows by pressing Yes: Delete selected file.
} Else {
SEND, {Delete} ; Command to delete the selected file.
}
Return
#IfWinActive
The feature you are making sounds very useful. Ill remember your offer.
Re: file Redirection (request)
i tried it on delete part didn't work . this autohotkey part is more important having 2 folders with same filenames and if delete one in a folder delete and the one from the other .
example
Originals folder filename a-0001, a-0002, a-0003, a-...
Shortcuts folder filename a-0001, a-0002, a-0003, a-...
if i delete filename a-0003 in Originals folder autodelete in Shortcuts folder and if i delete filename a-0003 in Shortcuts folder auto-delete in Originals folder .
the part auto-open is no more necessary cause i check in shortcuts folder if some pages are double or missed and i have open windows viewer for originals images so i go to the filename and delete or take note from the missed page and then i delete and the shortcut file.
example
Originals folder filename a-0001, a-0002, a-0003, a-...
Shortcuts folder filename a-0001, a-0002, a-0003, a-...
if i delete filename a-0003 in Originals folder autodelete in Shortcuts folder and if i delete filename a-0003 in Shortcuts folder auto-delete in Originals folder .
the part auto-open is no more necessary cause i check in shortcuts folder if some pages are double or missed and i have open windows viewer for originals images so i go to the filename and delete or take note from the missed page and then i delete and the shortcut file.
Re: file Redirection (request)
I wrote it so it will only work in the Original folder. Don't know if you tested them both? However the way I wrote it is a bit clumsy because it expects the system to respond on a simulated Delete key stroke. But this way I hope to prevent deleting files which can't be retreived via the recycle bin.
If you realy want it working, which you say you don't, let me know what goed well and what goes wrong.
Glad I could help.
If you realy want it working, which you say you don't, let me know what goed well and what goes wrong.
Glad I could help.
Re: file Redirection (request)
o you are right . i deleted from windows viewer and didnt work . But if i am in original folder and delete files everything is fine . tried to works with 2 scripts . one from original delete shortcuts and from shortcuts delete origininal
Who is online
Users browsing this forum: doodles333, exodus_cl, ratyrat, Sniperman and 373 guests