Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • December 10, 2016, 12:27:23 PM
  • Proudly celebrating 10 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

Last post Author Topic: create shortlinks to urls in a folder from a txt file with the url list  (Read 10279 times)

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #25 on: August 25, 2015, 04:54:27 PM »
Given that you have a textfile with one URL per line then this autohotkey script should do the trick. Adjust the paths to what folders you'll use.
Loop, Read, C:\folder\textfilewithoneURLperline.txt
{
name := StrReplace(A_LoopReadLine,"http://","")
name := StrReplace(name,"https://","")
name := SubStr( RegExReplace(name, "[/<>\?\\:*\|]"," ") , 1, 70)
IniWrite, A_LoopReadLine, C:\urlfolder\%name%.url, InternetShortcut, URL
}

If you use Firefox then maybe FFBookmarkUnpack may be of use to do a one time unpack of all your firefox bookmarks into subfolders with .url files, http://nod5.dcmember...ookmarkunpacker.html


The ahk script works very well too.
Best Regards


« Last Edit: August 26, 2015, 10:19:09 AM by Contro »

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #26 on: August 25, 2015, 05:35:32 PM »
Just studying and re-linking an re-vising and re-memoring .
Damn Memory !!!!!!!!!!!!

I have shortcutty from Nod5
*** JOSE ***  June 4, 2010 at  1:24am
   Shortcutty

Overview:

Shortcutty adds a context menu entry to Explorer to create a shortcut and place it in another folder.
The (optional) companion tool Shortcutta moves shortcuts from a folder to the active Explorer window's folder when a hotkey is pressed.

I am trapped now with FileNotes.


I also found a script from Ewemoa about shortcuts

And diving in the wonderful world of JSON

Wait for me , eh . I don't have a quick and easy answer...

 :P

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #27 on: August 25, 2015, 07:22:05 PM »
I need to reiniate now.
I am observing the cursor thinking.
I have adopted again shortcutty.
I like alto FileNoter.
After strange behavior with Everything bookmarks seems not appear . I have several. But finally i go to the folder and process in the ini file of ffbookunpacker .
Seems perfect and very powerful.
But i have the cursor blinking sometimes and need to reiniate.
A strange thing happen to me was the false dissapearing of an "unpacker" folder i create in my desktop. But was here.
 :-[

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #28 on: August 25, 2015, 07:35:08 PM »
Trying again with Everything
In the closing i receive error about BtTray.exe , seem to be related with bluetooth device.
now the bookmarks.html appear with 28959 kb . Before was 8 kb and seems to be dissapeared, but the value was correct inspecting the folder.
So seems Everything.
I have now a powerful unpacker folder created by ffbookmarksunpacker
If I move the cursor out of this edit window the thinking circle in windows 8.1 appear. Is normal ?
Well i am going to put ffbookmarksunpacker in the startup folder.

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #29 on: August 25, 2015, 07:39:15 PM »
I launch ffbookmarksunpacker.exe with 15 seconds delayed with startup delayed
 :P

I continue with JSON world and the scripts from 4wd

Best Regards

Thanks a lot Nod5 for good scripting

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #30 on: August 26, 2015, 10:19:55 AM »
Given that you have a textfile with one URL per line then this autohotkey script should do the trick. Adjust the paths to what folders you'll use.
Loop, Read, C:\folder\textfilewithoneURLperline.txt
{
name := StrReplace(A_LoopReadLine,"http://","")
name := StrReplace(name,"https://","")
name := SubStr( RegExReplace(name, "[/<>\?\\:*\|]"," ") , 1, 70)
IniWrite, A_LoopReadLine, C:\urlfolder\%name%.url, InternetShortcut, URL
}

If you use Firefox then maybe FFBookmarkUnpack may be of use to do a one time unpack of all your firefox bookmarks into subfolders with .url files, http://nod5.dcmember...ookmarkunpacker.html


The ahk script works very well too.
Best Regards




Sorry i edited this post.

As i said the script works wonderfully
Best Regards
 :-*

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #31 on: August 26, 2015, 10:38:29 AM »
Do you really need 3 threads in this forumsection to ask 3 times the same question? :(

Oh, and the other 2 already have been answered properly, too...

Ath i can't access your web :

Lost connection to MySQL server at 'reading initial communication packet', system error: 111

Best Regards

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #32 on: August 26, 2015, 12:23:12 PM »
The OP says: "...create shortlinks to urls in a folder ...in the desktop of our election ... from a txt file with the url list.
I have to ask:
  • Why?
  • What will you do with/How will you access/use those shortlinks in that folder?
  • What's wrong with using Bookmarks?

Also, yes, your making 3 or so overlapping posts on the same subject is somewhat confusing.

I am revising my bookmarks because i have a lot of problemas syncronizing in the past.
Folders with urls repeated even ten or more times.
Folders repeated everywhere and so on

I know where are the security copies.
 :-*

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #33 on: August 26, 2015, 12:47:13 PM »
I am with Y:\FIREFOX PERFILES\PEPE\sessionstore-backups\recovery.js

is in a data disk
 :-*

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #34 on: August 26, 2015, 01:04:22 PM »
Now the difficult part.

I have to modify the line

C:\> powershell.exe -noprofile -executionpolicy bypass -File ".\JSON2Shortcut.ps1"


I opened a console and try
The command seems recognigzed. So good for me.


The prior command is the script is in my desktop would be :

C:\> powershell.exe -noprofile -executionpolicy bypass -File ".\JSON2Shortcut.ps1"

C:\> powershell.exe -noprofile -executionpolicy bypass -File "C:\Users\JOSE\Desktop\JSON2Shortcut.ps1"

I will revise now the links
perhaps is better first to try to put the JSON2Shortcut.ps1 in the same directory than powershell.exe....

 :-[



Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #35 on: August 26, 2015, 01:06:08 PM »
I am revising too if i really have version 3
C:\Windows\System32\WindowsPowerShell\v1.0

 :o

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #36 on: August 26, 2015, 01:20:29 PM »
It seems the version correct because of your links.

But for me don't go.
I need support. So i am going to a JSON forum

Anyone knows one ?

Best Regards

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,477
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #37 on: August 27, 2015, 02:08:09 AM »
I am with Y:\FIREFOX PERFILES\PEPE\sessionstore-backups\recovery.js

Code: PowerShell [Select]
  1. if (!(Test-Path -Path "Y:\FIREFOX PERFILES\PEPE\sessionstore-backups\recovery.js")) { Exit }
  2. $opentabs = (Get-Content "Y:\FIREFOX PERFILES\PEPE\sessionstore-backups\recovery.js") | ConvertFrom-Json  # Firefox

Quote
C:\> powershell.exe -noprofile -executionpolicy bypass -File "C:\Users\JOSE\Desktop\JSON2Shortcut.ps1"

If it's on your Desktop why aren't you running it from the shortcut it came with, (ie. put the shortcut on the Desktop also)?
« Last Edit: September 02, 2015, 07:53:29 AM by 4wd »

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #38 on: August 27, 2015, 10:04:46 AM »
I am with Y:\FIREFOX PERFILES\PEPE\sessionstore-backups\recovery.js

Code: Text [Select]
  1. if (!(Test-Path -Path "Y:\FIREFOX PERFILES\PEPE\sessionstore-backups\recovery.js")) { Exit }
  2. $opentabs = (Get-Content "Y:\FIREFOX PERFILES\PEPE\sessionstore-backups\recovery.js") | ConvertFrom-Json  # Firefox

Quote
C:\> powershell.exe -noprofile -executionpolicy bypass -File "C:\Users\JOSE\Desktop\JSON2Shortcut.ps1"

If it's on your Desktop why aren't you running it from the shortcut it came with, (ie. put the shortcut on the Desktop also)?

It's running well now.
The scripts includes the pinned tabs from the active session i suppose.

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #39 on: August 27, 2015, 10:08:44 AM »
Nod5 I am having doubts with :

"If you use Firefox then maybe FFBookmarkUnpack may be of use to do a one time unpack of all your firefox bookmarks into subfolders with .url files, http://nod5.dcmember...ookmarkunpacker.html"

I have been modifying my bookmarks.
And finally when reiniate the system o execute the program I don't get the shortlinks. Only the empty folders.
I even delete the entire folder and repeat but just the same.
I only obtaining empty folders.



Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #40 on: August 27, 2015, 10:21:57 AM »
I am repeating the experience with the original ahk file but happen the same.
By some reason the script don't go in my system now.

the ini file is :
;-- 1. Set an unpack folder where bookmarks are copied
;-- 2. Set Firefox profile folder
;-- note: to find the profile folder, type about:support and enter in Firefox,
;-- and then click "Show Folder" on the page that loads
[options]
unpack_folder=C:\Users\JOSE\Desktop\Unpacker
profilefolder=Y:\FIREFOX PERFILES\PEPE


I am executing from the same directory where the ini file is

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #41 on: August 27, 2015, 01:40:08 PM »
 ;D
At least seems i have discovered the problem with the thinking circle of the windows 8.1 cursor

It seems associated to Asus Smart Gesture Loader.
I kill the process and finish the problem


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,290
    • View Profile
    • Miles Ahead Software
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #42 on: August 27, 2015, 02:52:18 PM »
;D
At least seems i have discovered the problem with the thinking circle of the windows 8.1 cursor

It seems associated to Asus Smart Gesture Loader.
I kill the process and finish the problem



Sounds like a nice gesture indeed.

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #43 on: August 27, 2015, 07:22:43 PM »
Do you really need 3 threads in this forumsection to ask 3 times the same question? :(

Oh, and the other 2 already have been answered properly, too...

Solved !  I can enter in your web now.
 :-*

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,341
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #44 on: August 28, 2015, 04:23:30 PM »
;D
the contrast there between the quote and the response just made my evening :-*
Tom

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #45 on: August 28, 2015, 05:51:32 PM »
;D
the contrast there between the quote and the response just made my evening :-*

 :-[
I am very engaged consulting in firefox forums about bookmarks
I am debugging why my system has so strange behaviour

I will inform
 :-*

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #46 on: August 29, 2015, 09:58:04 AM »
My first error : bookmarks.html is not the bookmark database in firefox (places.sqlite)

But for me now don't go ffbookmarksunpack.ahk . Only creates empty folders.
I have maintained the above database (places.sqlite) with a firefox addon places maintenance
i have tried in other pc with the same result.

But I could in the past with ffbookmarksunpack.ahk . So i am making something wrong i don't know

I think is time to ask for help to Nod5

 :P

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #47 on: August 29, 2015, 10:07:50 AM »
I have put to true in about:config
browser.bookmarks.autoExportHTML

and have located the profile firefox folder with
about:support - show folder -Y:\FIREFOX PERFILES\PEPE

closes firefox . execute ffbookmarksunpack.exe

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,619
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #48 on: August 30, 2015, 12:45:31 PM »
In firefox forums the only related problem may be with :

Y:\FIREFOX PERFILES\PEPE

a space may be the problem with the script ?
 :-[

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 858
    • View Profile
    • Donate to Member
Re: create shortlinks to urls in a folder from a txt file with the url list
« Reply #49 on: September 02, 2015, 10:41:10 AM »
Hi Contro. The paths can contain spaces, that is not the issue.

Are you sure you have the correct path to the profile folder?
My path has this format (the xi3je3ww.default part is the name of a folder not a file):
C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\xi3je3ww.default

Have you doublechecked that there is a file named bookmarks.html in the profile folder? (IIRC firefox writes to that file when the browser closes so you may have to close and restart Firefox in order for that file to appear.)

If there is a bookmarks.html in the profile folder then perhaps there is some language dependent variation in syntax that trips up the script. Could you post a small snippet from that file, a few lines that shows an url or two would be enough.

Another thing to check: perhaps there is a write permission issue. Test changing the output folder to something else e.g. C:\testfolder and see if that makes a difference.