Xplorer Bookmarks - Explorer favorites integration?
Moderators: fgagnon, nikos, Site Mods
- bellig_cat
- New Member
- Posts: 7
- Joined: 2007 Jun 19, 17:50
Xplorer Bookmarks - Explorer favorites integration?
I've done my diligence searching for this and I honestly couldn't find any direct references to this so if it's been covered I apologize. I use Xplorer pretty much exclusively and the largest drawback I run into day to day is that when I want to save files using other applicaitons, (word, firefox, etc) I have to browse those directories manually. They are in my Xplorer bookmarks but 3rd party apps all call Win Explorer for the SaveAs dialogs. The new Favorites list in explorer is somewhat mini scrap like, and great for navigating this sort thing but I end up managing the same list in 2 places. I'm curious if there is a way to synchronize Xplorer's bookmarks with Windows Explorer's favorites (C:\users\{username}\links). I was hoping to simlink explorer's "links" directory to xplorer's "bookmarks" directory but because xplorer stores bookmarks in the registry it's an apples and oranges situation. Any ideas?
Re: Xplorer Bookmarks - Explorer favorites integration?
As you read the following, please remember you did ask.bellig_cat wrote:Any ideas?
Now this is interesting. One's first reaction is to simply say "No, that's not directly possible" (given your rather apt Apples vs. Oranges analogy), however, it would be conceivable to write a script which could dump the contents of "HKCU\Software\ZabaraKatranemia Plc\xplorer2_UC.global\Favorites" to a text file, then regenerate/regurgitate that list as a series of file-system object links which could (with some added nicotine and caffeine ) be de-facto "synced" with the \users\{username}\links folder contents.bellig_cat wrote:...because xplorer stores bookmarks in the registry it's an apples and oranges situation.
Initially, this would be a one-way synch - in other words, (the "easy part" is) x2 -> {User}/Links, so x2's bookmarks would be available in the modal windows' Favourites list. With a bit ( ~ read: "one Hell of a lot") of testing, this could conceivably be reverse engineered to recreate the actual ".global\Favorites" registry key from {User}\Links itself, depending on exactly how x2 manages its knowledge of the key's contents therein.
It would (postulating) take the form of a small external utility which could be executed manually from time to time (after x2's settings are saved, as the Bookmarks are not stored "live" in the Registry - that key is only populated upon saving). Perhaps she wouldn't be the prettiest girl you ever took to the prom, but by God your mum would love her resourcefulness.
Without even a rudimentary proof-of-concept code snippet, consider this merely a theoretical solution, but I would happily suggest it as a competition for our aspiring scripters (or bored literati ) and given a week or so I could probably whip something up as a learning experience akin to Hannibal crossing the mice-infested Alps. We might get there in the end, but I imagine one or two elephants could get a dose of the flu (or frightened to death) before we got into Italy proper. (And the amateur historian in me is ever mindful of what happened to Carthage a few short decades later.)
It kind of depends on how much of a masochist I feel come Saturday morning (I'm serious).
So, short answer: "No, you can't do this".
Long answer: "Read the above and consider bribery as an acceptable sin".
On a related note, those SaveAs windows you see are not actually Windows Explorer, they are system "modals" (interactive bespoke windows routines) which applications can modify to their own needs presenting the user with a quasi-familiar interface for file-system interaction without the 3rd-party application itself actually needing to do too much work. These modals are notoriously difficult (but not impossible) for other applications (such as file-managers or explorer extensions) to intercept themselves, thus you'll find pitifully few utilities which attempt it and which are still in development. (So don't expect a proper solution to involve this.)
That said, as a member of an IMF-infested country who has thus far made fair stab at cheating the tax-man, there's no reason I shouldn't throw my cap in the ring and not try to cheat death as well. This could be fun (that masochistic thing again), and, like you, I might find this kind of useful ( ~ read: "painful").
It wouldn't be a perfect solution, but better to crash and burn on the way to the prom than rather to have never been invited in the first place. Let me cogitate on this for a few days and we'll see what happens. (This could take longer than the proposed week.)
(Of course, if I'm wrong and there's a simpler way anyone knows of doing this, please speak up and save me from my inevitable ritual self-immolation. Please. I mean that. Please speak up. Loudly.)
Other programs...
OK, so not directly a solution to your problem
Essential bookmarks could be added to programs such as:
FileBox eXtender http://www.hyperionics.com/files/index.asp
Dirkey http://www.protonfx.com/dirkey/
Dirkey had a xplorer2 plugin available http://www.protonfx.com/dirkey/plugins.php
With these applications you can add your bookmarks (again) to them, and have quick access to the places from Windows Explorer open/save dialogs.
--
Osei
Essential bookmarks could be added to programs such as:
FileBox eXtender http://www.hyperionics.com/files/index.asp
Dirkey http://www.protonfx.com/dirkey/
Dirkey had a xplorer2 plugin available http://www.protonfx.com/dirkey/plugins.php
With these applications you can add your bookmarks (again) to them, and have quick access to the places from Windows Explorer open/save dialogs.
--
Osei
Last edited by profess on 2011 Feb 03, 02:23, edited 1 time in total.
Live life...
Assuming DirKey and its 7-year-old (!) x2 plugin still work on contemporary operating systems (and contemporary [x64] versions of x2) that sounds like a decent solution to me. (Thank God.)
Unfortunately those two utilities were what I had in mind when I said any projects aimed at modifying modals were well "out of development".
Unfortunately those two utilities were what I had in mind when I said any projects aimed at modifying modals were well "out of development".
- bellig_cat
- New Member
- Posts: 7
- Joined: 2007 Jun 19, 17:50
Thank you both for the suggestions.
@profess: I checked out Dirkey and FileBox but I'm apprehensive about investing time in unsupported software. I put a lot of thought and effort into the way I tweak and config every utility I use. So the idea of putting all that time in only to see the app fall short of current standards and leave me looking for a replacement just isn't appealing. I did recall seeing a lifehacker feature on a similar utility though so I went digging and found it: http://foldermenu.sourceforge.net/ Source is AutoIt too so if I"m so inclined I could bend it a bit. Possibly read the directory entries from X2's bookmark registry pool????
@Kilmatead: Where to begin. Your suggestions are all valid and informative yet I'm compelled to equally regard your prose. Fitting a history lesson into a scripting metaphor. Well done. Along side the aforementioned foldermenu, I will also investigate scripting a "push" from the Zab reg files to shortcuts in the links directory. The translation is pretty 1 to 1 as far as there being a bookmark.name/.path and a shortcut.name/.target. If anyone else is interested I can post back with the results.
@profess: I checked out Dirkey and FileBox but I'm apprehensive about investing time in unsupported software. I put a lot of thought and effort into the way I tweak and config every utility I use. So the idea of putting all that time in only to see the app fall short of current standards and leave me looking for a replacement just isn't appealing. I did recall seeing a lifehacker feature on a similar utility though so I went digging and found it: http://foldermenu.sourceforge.net/ Source is AutoIt too so if I"m so inclined I could bend it a bit. Possibly read the directory entries from X2's bookmark registry pool????
@Kilmatead: Where to begin. Your suggestions are all valid and informative yet I'm compelled to equally regard your prose. Fitting a history lesson into a scripting metaphor. Well done. Along side the aforementioned foldermenu, I will also investigate scripting a "push" from the Zab reg files to shortcuts in the links directory. The translation is pretty 1 to 1 as far as there being a bookmark.name/.path and a shortcut.name/.target. If anyone else is interested I can post back with the results.
first of all you can create all xplorer2 bookmarks in C:\users\{username}\links: just paste shortcuts to the folders you want. Accessing the bookmarks from within xplorer2 becomes slightly more difficult but if you set the quick-bookmark on C:\users\{username}\links (goto menu) you can access your shared bookmarks with ctrl+F1 followed by a click
from the opposite direction you can copy paths from xplorer2 to these system file open/save boxes with path text copying as explained here
http://www.zabkat.com/blog/wink/hotmail.htm
from the opposite direction you can copy paths from xplorer2 to these system file open/save boxes with path text copying as explained here
http://www.zabkat.com/blog/wink/hotmail.htm
That's why they keep me around.bellig_cat wrote:Fitting a history lesson into a scripting metaphor.
AutoIt: Yeah, that's what I was thinking of using myself, so I'd be interested in your approach. I envisaged (as a rough first thought) simply calling regedit with a command line parameter to extract the .reg file automatically to @TempDir and then filter that. The trouble with reading the key directly is getting the dynamic ValueNames (never mind the number of them), so a text file is easiest to munch on. A few FileCreateShortcut() calls later (with some name checking to prevent duplicates) and Bob's your uncle: you have two folders of shortcuts to merge. Not as elegant as a plug-in, but you probably don't need to repopulate the list everyday so real-time seems overkill just for this. (It's synching the "other way" that could prove somewhat messy, and perhaps of lesser value.)
In fact, for simplicity, you could forego relying on \Links (Favourites) at all, and put your dump-folder in [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\PlacesBar] as "Place0"="\PunicFolders", which conveniently places a custom folder permanently in the modal's left pane so it's always immediately available. (That's what I use now.) You can set up to five places in the list:
"Place0"="C:\\Etrangere"
"Place1"="C:\\Users\\Kilmatead"
"Place2"=dword:00000000 (; "Desktop")
"Place3"=dword:00000011 (; "Computer")
"Place4"="N:\"
...which customises those (otherwise non-adjustable) dialogues with more convenient choices permanently without fuss. Something to look into, anyway.
You'll note that (in newer windows versions) there are actually two different styles of modals, the legacy XP one (which the above modifies) which is there for older applications to still call, and a newer/younger/prettier version which more middle-aged applications like Firefox tend to use instead of buying a Ferrari to placate their 21-year-old girlfriends (this looks even more like Win Explorer proper - yet still isn't). As examples, Firefox (as mentioned) is the new one, and if you put something in a scrap pane and select Actions -> Write Contents you'll see an example of the "old one" (dear Nikos ever the antiquarian). The modern dialogue doesn't echo the \comdlg32\PlacesBar changes, but those can be adjusted manually (only once is necessary) to at least direct the tourists to the battlefields of the Punic Wars so they can buy their commemorative t-shirts and coffee-mugs in a more convenient one-stop-shop (as they are wont to do).
The First Punic War Begins
Ok, as I was bored and wanted to get this out of the way, I whipped up this AutoIt script for you, replete with a GUI just so you can be sure of what you're doing before you do it:
Edit: For those without an interest in historical allusions or playing with scripts, a "proper boring version" of this can be downloaded from here (392 KB) Last updated 03-Apr-11
Now, this is fairly self explanatory - when you run the script it automatically generates the bookmarks from x2's registry and displays them on the left, while the list on the right contains the current contents of your "Users\...\Links" folder. If duplicates are selected to be shown (not the default), any items coloured blue are already in the Favourites list, and as such they are automatically unchecked. Links can be compared by Name or by Target (default), so "Étrangère" and "Etrangere" may or may not match depending on "Compare by" if they point the same place. If matching by "Target" any links displayed in red used CLSID addresses as the link target, and as such cannot be compared to anything as AutoIt's FileGetShortcut() function can't retrieve a proper link to compare it to.
Note that x2 allows "illegal characters" in bookmark names, like ":" and "*", etc. I did a rudimentary strip in line 211 with StringRegExpReplace() to remove the common ones (replacing them with underscores '_'), but it should probably be expanded for completeness.
When you click "impetum facere" (it seems fitting to attack in Latin, no?), obviously the selected (checked) bookmarks will be created as proper .LNK files in your \Links folder, and the display will update (so whatever you just transferred will turn blue, as it's now a duplicate, and appearing in the Favourites column as well).
If you made a mistake and don't want a particular item in your Links folder, just Right-Click it in the second column and select "Delete Link" from the context menu. (It shouldn't be that hard to find as there is only one command in that context menu. ) The other column has a boring context menu for "Select\De-select All" and "Matching".
Remember that x2's registry is only updated when you actually save settings (manually or automatically on exit), so any new bookmarks that you made while x2 is still open won't be in the list - so just save your settings, and click the "Refresh" button - and the list will be repopulated to include (or exclude, in the case of deleting some) the appropriate bookmarks.
For simplification purposes, this script can't do the reverse - in other words, you can't put Bookmarks into x2 from the Links folder - I decided that was madness to attempt in the couple of hours I used for this. Doesn't really seem that practical anyway, so I feel properly self-justified now for not including it.
When the script exits, it automatically deletes the objects (1 reg file and one folder) it created in your temporary folder (that's the only location where processing is done), so everybody's happy.
Hope you like it - the script is "fairly" self-explanatory so you should be able to modify anything you like, if you feel the need. Or, just ask.
Obviously, you need AutoIt to run it (I could have just supplied the compiled version as a link, but where's the fun in that?). You expressed familiarity with it earlier, so I assume you probably have it already.
It's a mere 220-odd lines, so nothing to get excited about. Just copy the following and save it as Hannibal.au3 , and away you go.
Ok, as I was bored and wanted to get this out of the way, I whipped up this AutoIt script for you, replete with a GUI just so you can be sure of what you're doing before you do it:
Edit: For those without an interest in historical allusions or playing with scripts, a "proper boring version" of this can be downloaded from here (392 KB) Last updated 03-Apr-11
Now, this is fairly self explanatory - when you run the script it automatically generates the bookmarks from x2's registry and displays them on the left, while the list on the right contains the current contents of your "Users\...\Links" folder. If duplicates are selected to be shown (not the default), any items coloured blue are already in the Favourites list, and as such they are automatically unchecked. Links can be compared by Name or by Target (default), so "Étrangère" and "Etrangere" may or may not match depending on "Compare by" if they point the same place. If matching by "Target" any links displayed in red used CLSID addresses as the link target, and as such cannot be compared to anything as AutoIt's FileGetShortcut() function can't retrieve a proper link to compare it to.
Note that x2 allows "illegal characters" in bookmark names, like ":" and "*", etc. I did a rudimentary strip in line 211 with StringRegExpReplace() to remove the common ones (replacing them with underscores '_'), but it should probably be expanded for completeness.
When you click "impetum facere" (it seems fitting to attack in Latin, no?), obviously the selected (checked) bookmarks will be created as proper .LNK files in your \Links folder, and the display will update (so whatever you just transferred will turn blue, as it's now a duplicate, and appearing in the Favourites column as well).
If you made a mistake and don't want a particular item in your Links folder, just Right-Click it in the second column and select "Delete Link" from the context menu. (It shouldn't be that hard to find as there is only one command in that context menu. ) The other column has a boring context menu for "Select\De-select All" and "Matching".
Remember that x2's registry is only updated when you actually save settings (manually or automatically on exit), so any new bookmarks that you made while x2 is still open won't be in the list - so just save your settings, and click the "Refresh" button - and the list will be repopulated to include (or exclude, in the case of deleting some) the appropriate bookmarks.
For simplification purposes, this script can't do the reverse - in other words, you can't put Bookmarks into x2 from the Links folder - I decided that was madness to attempt in the couple of hours I used for this. Doesn't really seem that practical anyway, so I feel properly self-justified now for not including it.
When the script exits, it automatically deletes the objects (1 reg file and one folder) it created in your temporary folder (that's the only location where processing is done), so everybody's happy.
Hope you like it - the script is "fairly" self-explanatory so you should be able to modify anything you like, if you feel the need. Or, just ask.
Obviously, you need AutoIt to run it (I could have just supplied the compiled version as a link, but where's the fun in that?). You expressed familiarity with it earlier, so I assume you probably have it already.
It's a mere 220-odd lines, so nothing to get excited about. Just copy the following and save it as Hannibal.au3 , and away you go.
Code: Select all
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListviewConstants.au3>
#include <GuiListView.au3>
#include <File.au3>
Opt("MustDeclareVars", 1)
Global Const $Quote = """"
Global $dCount
Global $Folder = @UserProfileDir & "\Links" ; Set folder to synch into
If Not FileExists($Folder) Then
MsgBox(16, "The First Punic War", "Folder '" & $Folder & "' does not exist")
Exit
EndIf
Global $BookmarkOnes[1][2], $FavouriteOnes[1], $TargetOnes[1] ; all Redimmed in Functions, declared here to avoid syntax warnings
Global $FilesArray, $FilesArray2, $a_pid
Global $Name, $Target, $RawLine, $Content
Global $WinParent = GUICreate("The First Punic War", 585, 400, -1, -1, BitOR($WS_OVERLAPPED, $WS_CAPTION, $WS_SYSMENU, $WS_MINIMIZEBOX))
GUISetFont(9, 400, 0, "Segoe UI")
Global $Button_AddTo = GUICtrlCreateButton("impetum facere ->", 218, 200, 150, 30)
GUICtrlSetState(-1, $GUI_FOCUS)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
GUICtrlSetFont(-1, 9, 800, 0, "Segoe UI") ; A little Love Emboldens even the most frightened heart
Global $Checkbox_ShowDups = GUICtrlCreateCheckbox("Show duplicates", 227, 40)
GUICtrlSetState($Checkbox_ShowDups, $GUI_UNCHECKED)
GUICtrlCreateGroup("Compare by:", 227, 130 - 40, 130, 85)
Global $Radio_Name = GUICtrlCreateRadio("Name ", 250, 153 - 40)
Global $Radio_Target = GUICtrlCreateRadio("Target ", 250, 178 - 40)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Button_Refresh = GUICtrlCreateButton("Refresh", 237, 300, 110, 30)
Global $Button_Close = GUICtrlCreateButton("Exit", 237, 350, 110, 30)
Global $QuintusFabiusBookmarks = GUICtrlCreateListView("Carthaginian Bookmarks", 15, 15, 200, 366, -1, $LVS_EX_CHECKBOXES)
GUICtrlSetBkColor($QuintusFabiusBookmarks, 0xC0C0C0)
_GUICtrlListView_SetColumnWidth($QuintusFabiusBookmarks, 0, 179)
Global $ContextMenu2 = GUICtrlCreateContextMenu($QuintusFabiusBookmarks)
Global $Context_SelectAll = GUICtrlCreateMenuItem("Select All", $ContextMenu2)
Global $Context_DeSelectAll = GUICtrlCreateMenuItem("De-select All", $ContextMenu2)
Global $Context_Matching = GUICtrlCreateMenuItem("Matching", $ContextMenu2)
Global $HannibalFavourites = GUICtrlCreateListView("Legionary Favourites", 371, 15, 200, 366, -1, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetColumnWidth($HannibalFavourites, 0, 179)
GUICtrlSetBkColor($HannibalFavourites, 0xC0C0C0)
Global $ContextMenu = GUICtrlCreateContextMenu($HannibalFavourites)
Global $Context_Delete = GUICtrlCreateMenuItem("Delete Link", $ContextMenu)
ReadFavourites()
ReadRegistryBookmarks()
ReadBookmarks()
GUISetState()
main()
Func main()
While 1
Switch GUIGetMsg()
Case $Button_AddTo
For $i = 0 To $dCount - 1
If BitAND(GUICtrlRead($BookmarkOnes[$i][0], 1), $GUI_CHECKED) = 1 Then
FileCopy(@TempDir & "\Carthage\" & $FilesArray2[$BookmarkOnes[$i][1]], $Folder, 1) ; Do the dirty deed
EndIf
Next
ReadFavourites()
ReadBookmarks()
SoundPlay(@WindowsDir & "\Media\Windows Exclamation.wav", 0)
Case $Radio_Name, $Radio_Target
ReadFavourites()
ReadBookmarks()
Case $Button_Refresh, $Checkbox_ShowDups
ReadFavourites()
ReadRegistryBookmarks()
ReadBookmarks()
Case $Context_Delete
$a_pid = _GUICtrlListView_GetSelectedIndices($HannibalFavourites, 1)
If IsArray($a_pid) And ($a_pid[0] = 1) Then
FileDelete($Folder & "\" & _GUICtrlListView_GetItemText($HannibalFavourites, $a_pid[1], 0) & ".lnk")
ReadFavourites()
ReadBookmarks()
EndIf
Case $Context_SelectAll
For $i = 0 To $dCount - 1
GUICtrlSetState($BookmarkOnes[$i][0], $GUI_CHECKED)
Next
Case $Context_DeSelectAll
For $i = 0 To $dCount - 1
GUICtrlSetState($BookmarkOnes[$i][0], $GUI_UNCHECKED)
Next
Case $Context_Matching
ReadBookmarks()
Case $Button_Close, $GUI_EVENT_CLOSE
Cleanup()
Exit
EndSwitch
WEnd
EndFunc
Func ReadFavourites()
_GUICtrlListView_DeleteAllItems($HannibalFavourites)
$FilesArray = _FileListToArray($Folder, "*.lnk", 1)
If @error <> 4 Then
Global $FavouriteOnes[UBound($FilesArray)] ; Redim and Clear
Global $TargetOnes[UBound($FilesArray)] ; ReDim and Clear
For $i = 1 To UBound($FilesArray) - 1
$FavouriteOnes[$i] = GUICtrlCreateListViewItem(StringReplace($FilesArray[$i], ".lnk", ""), $HannibalFavourites)
$a_pid = FileGetShortcut($Folder & "\" & $FilesArray[$i])
If $a_pid[0] = "" Then
If BitAND(GUICtrlRead($Radio_Name), $GUI_CHECKED) = 0 Then
GUICtrlSetColor($FavouriteOnes[$i], 0xFF0000) ; Display as Red as no matches are possible by location
EndIf
$TargetOnes[$i] = "<<CLSID>>" ; Can't accidentally match anything else
Else
$TargetOnes[$i] = $a_pid[0]
EndIf
Next
EndIf
EndFunc
Func ReadBookmarks()
Local $Name, $Found
$dCount = 0
_GUICtrlListView_DeleteAllItems($QuintusFabiusBookmarks)
$FilesArray2 = _FileListToArray(@TempDir & "\Carthage", "*.lnk", 1)
If @error <> 4 Then
Global $BookmarkOnes[UBound($FilesArray2)][2] ; Redim and Clear
For $i = 1 To UBound($FilesArray2) - 1
$Name = StringReplace($FilesArray2[$i], ".lnk", "")
$a_pid = FileGetShortcut(@TempDir & "\Carthage\" & $FilesArray2[$i])
If BitAND(GUICtrlRead($Radio_Name), $GUI_CHECKED) = 1 Then
$Found = _ArraySearch($FilesArray, $FilesArray2[$i], 1) ; Try and match by name
Else
$Found = _ArraySearch($TargetOnes, $a_pid[0], 1) ; Try by location
EndIf
Switch $Found
Case -1 ; Not Found
$BookmarkOnes[$dCount][0] = GUICtrlCreateListViewItem($Name, $QuintusFabiusBookmarks)
$BookmarkOnes[$dCount][1] = $i
GUICtrlSetState($BookmarkOnes[$dCount][0], $GUI_CHECKED)
If $a_pid[0] = "" Then GUICtrlSetColor($BookmarkOnes[$dCount][0], 0xFF0000) ; Red
$dCount += 1
Case Else ; Found
If BitAND(GUICtrlRead($Checkbox_ShowDups), $GUI_CHECKED) = 1 Then
$BookmarkOnes[$dCount][0] = GUICtrlCreateListViewItem($Name, $QuintusFabiusBookmarks)
$BookmarkOnes[$dCount][1] = $i
GUICtrlSetColor($BookmarkOnes[$dCount][0], 0x0000A0) ; Blue
$dCount += 1
EndIf
EndSwitch
Next
EndIf
EndFunc
Func ReadRegistryBookmarks()
Local $FixedName, $Link, $Icon, $IconRef, $IconRefNum, $Err
Cleanup()
DirCreate(@TempDir & "\Carthage")
RunWait($Quote & @WindowsDir & "\regedit.exe" & $Quote & " /e " & _
$Quote & @TempDir & "\Carthage\HannibalsRearGuard.reg" & $Quote & " " & _
$Quote & "HKEY_CURRENT_USER\Software\ZabaraKatranemia Plc\xplorer2_UC.global\Favorites" & $Quote, "", @SW_HIDE)
Local $tFile = FileOpen(@TempDir & "\Carthage\HannibalsRearGuard.reg", 0)
FileReadLine($tFile, 3) ; Disregard the redundant reg5 header (3 lines)
Do
$RawLine = FileReadLine($tFile)
$Err = @error
$Content = StringLen($RawLine) ; RegEdit adds extra linefeeds at the end of its export - consider the first an EOF
If Not $Err And $Content Then
$RawLine = StringReplace($RawLine, """", "") ; Remove quotations
$RawLine = StringReplace($RawLine, "\\", "\") ; Remove doublestrikes
$Link = StringSplit($RawLine, "=") ; Left (Link[1]) is Bookmark Name, Right (Link[2]) is Location
$FixedName = StringRight($Link[1], StringLen($Link[1]) - 3)
$Icon = RegRead("HKEY_CURRENT_USER\Software\ZabaraKatranemia Plc\xplorer2_UC.global\Favorites_icons", $FixedName)
$IconRef = StringSplit($Icon, ",")
If $IconRef[0] = 1 Then
$IconRefNum = 0
Else
$IconRefNum = Number($IconRef[2])
$Icon = $IconRef[1]
EndIf
$FixedName = StringRegExpReplace($FixedName, "[\\\*.,:]", "_") ; Strip out illegal filename characters
FileCreateShortcut($Link[2], _
@TempDir & "\Carthage\" & $FixedName & ".lnk", _
"", _
"", _
"", _
$Icon, _
"", _
$IconRefNum)
EndIf
Until $Err Or Not $Content
FileClose($tFile)
EndFunc
Func Cleanup()
DirRemove(@TempDir & "\Carthage", 1)
EndFunc
Last edited by Kilmatead on 2011 Apr 03, 20:49, edited 4 times in total.
-
- Silver Member
- Posts: 281
- Joined: 2006 Dec 29, 12:56
- Location: Utrecht, NL
Originally, this was meant as a complex joke (who else besides me would write a 220-line script with a GUI just to sync a few bookmarks?) - however after playing with it a bit, I remembered that I actually keep a corollary list of bookmarks in Windows Explorer anyway (by way of the Classic Shell extension - which just got an update, by the way, for those who use it), and it struck me that it might actually have a practical use after all. (That said, I tend to take a perverse pleasure in putting a lot of effort into things no one will ever use - it's an absurd comment on the futility of life when faced with the human condition. ) Seems no one "got" the joke anyway.
Small update: I had forgotten to embed the user-defined Icon images from the x2 bookmarks registry into the links, so that's fixed now, if anyone's interested. The Devil really is in the details.
Small update: I had forgotten to embed the user-defined Icon images from the x2 bookmarks registry into the links, so that's fixed now, if anyone's interested. The Devil really is in the details.
- bellig_cat
- New Member
- Posts: 7
- Joined: 2007 Jun 19, 17:50
I'm just not smart enough to get it. I really want to be but It's not clicking.
Basics, X2=Carthage, Explorer=Rome (who wins in the end)
Will X2 loose to Microsoft in the end?
Is Microsoft building a dominant navy fleet while Nikos lacks the funds to maintain or rebuild his once dominant naval power?
Or more likely did you script this utility only to find your efforts futile and your energy diminished. Doesn't seem like it. As long as no one asks you for any tonnage of silver I'd say you're in the clear.
I prefer to analogize x2 as the seeming underdog, MS/Explorer as the would be dominant Carthaginian navy and your script/utility as the ever shifty corvus that levels the playing field.
Thanks so much for the code contribution and the history lesson. Both good reads!
Basics, X2=Carthage, Explorer=Rome (who wins in the end)
Will X2 loose to Microsoft in the end?
Is Microsoft building a dominant navy fleet while Nikos lacks the funds to maintain or rebuild his once dominant naval power?
Or more likely did you script this utility only to find your efforts futile and your energy diminished. Doesn't seem like it. As long as no one asks you for any tonnage of silver I'd say you're in the clear.
I prefer to analogize x2 as the seeming underdog, MS/Explorer as the would be dominant Carthaginian navy and your script/utility as the ever shifty corvus that levels the playing field.
Thanks so much for the code contribution and the history lesson. Both good reads!
That was the analogy, not the joke. As this was the First Punic War, Carthage had its moments, so I felt sorry for poor Quintus Fabius - Hannibal was all of seven years old when that war ended, but obviously it made an impression on him so he didn't actually get to play with his toys until the Second. The joke had nothing to do with that though - it was simply that in my preamble I expected this utility to take awhile to create, whereas it actually only took a few hours, with the emphasis on complete overkill (allusion to the Third end-game, of course). x2 is more painted as the spirit of Carthage (without the sticky end) so I was playing a bit loose with the facts - never mind that AutoIt could be conceived as the hired mercenaries - but who paid for them and what part did they play?bellig_cat wrote:Basics, X2=Carthage, Explorer=Rome (who wins in the end)
A few years later, of course, Gibbon was to eulogise militarism itself as the ultimate end of Microsoft:
There is a lot to say for having emotional sympathies in assigning blame for epochal disintegration, but to blame it all on one man (in the same way as only Hannibal is remembered in the public consciousness in a Fitzcarraldo-esque way) there is the faintest sense of guilt in my having fun with genocide.The contemporaries of Severus in the enjoyment of the peace and glory of his reign, forgave the cruelties by which it had been introduced. Posterity, who experienced the fatal effects of his maxims and example, justly considered him as the principal author of the decline of the Roman empire.
But then the guilt goes away, and we are free to pursue the true end (beginning): Philip the Second and his slightly ambitious offspring.
The old adage about "not reading too much into things" could apply here. But hey, fun is fun. I really just wanted a button that said "impetum facere" because every boring utility on the planet uses things like "Ok", "Go", "Confirm", etc, without having the slightest notion of where the concept actually originated, and how every day we click on thousands of bloodless buttons, with no emotional attachment at all. Who was the character in the Sopranos who always ran around saying "Strength and Honour!" in celebration of a fictional hero he believed represented his ethos?
My buffoonery is much the same, but I like to think the undercurrent has some weight behind it.
-
- Bronze Member
- Posts: 106
- Joined: 2004 Jul 11, 14:55
Kilmatead: Since I wanted to see what happened, I ran your AutoIt script.
Received an error popup with the following text:
AutoIt Error
Line 118 (File "P:\Arc1\Hannibal.au3"):
Global $FavouriteOnes[UBound($FilesArray)]
Global $FavouriteOnes[^ ERROR
Error: Array variable subscript badly formatted.
Mean anything to you (since I have yet to play with AutoIt)?
Received an error popup with the following text:
AutoIt Error
Line 118 (File "P:\Arc1\Hannibal.au3"):
Global $FavouriteOnes[UBound($FilesArray)]
Global $FavouriteOnes[^ ERROR
Error: Array variable subscript badly formatted.
Mean anything to you (since I have yet to play with AutoIt)?
That's a runtime error that happens if the folder you're syncing to doesn't exist ("\Links" should exist by default in your user folder if you use Vista or Win7).
Check line 11:
Global $Folder = @UserProfileDir & "\Links" ; Set folder to synch into
...and make sure it points to an existing folder (even if it's an empty one). Are you using XP? Perhaps XP doesn't use the same folder for those shortcuts as later versions of windows?
If you just want to see what the script does, just create a folder anywhere and place its path in line 11. Obviously it won't have any effect on explorer, but it will give you an idea of how syncing works.
(Script updated to exit with error message if defined folder doesn't exist, "just in case".)
Check line 11:
Global $Folder = @UserProfileDir & "\Links" ; Set folder to synch into
...and make sure it points to an existing folder (even if it's an empty one). Are you using XP? Perhaps XP doesn't use the same folder for those shortcuts as later versions of windows?
If you just want to see what the script does, just create a folder anywhere and place its path in line 11. Obviously it won't have any effect on explorer, but it will give you an idea of how syncing works.
(Script updated to exit with error message if defined folder doesn't exist, "just in case".)
Last edited by Kilmatead on 2011 Feb 12, 00:52, edited 2 times in total.
-
- Bronze Member
- Posts: 106
- Joined: 2004 Jul 11, 14:55