Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Desktop Internet Shortcut
#1
Hi Gindi,

Is there a way to use the CreateShortcut function to create internet shortcuts, or could it be updated to have that functionality? I like to use temporary internet shortcuts on the desktop.


-Jimbog
#2
Macro Macro1185
Code:
Copy      Help
str s=
;[InternetShortcut]
;URL=http://www.quickmacros.com/forum/viewtopic.php?p=17612
s.setfile("$desktop$\zxcv.url")
#3
Thanks. I just rearranged your code a bit to try to incorporate into a macro.
Macro 1 below seems to work OK. Macro 2 does not work. Any ideas? They are the same thing, at least that's what I thought.

Code:
Copy      Help
;Macro 1

str name="zxcv"
name+".url"
name-"$desktop$\"

str address="http://www.quickmacros.com/forum/viewtopic.php?p=17612"
address-"[InternetShortcut] URL="

out name
out address

address.setfile(name)


;Macro 2

str name="yahoo"
name+".url"
name-"$desktop$\"

str address="http://my.yahoo.com/"
address-"[InternetShortcut] URL="

out name
out address

address.setfile(name)
#4
On my PC sometimes works, sometimes not. Two files are identical, but file 1 works, file 2 not. Or works if URL but does not if url. Now works again after restarting firefox.

Macro Macro1193
Code:
Copy      Help
str name="yahoo2"
name+".url"
name-"$desktop$\"

str address="http://my.yahoo.com/"
address-"[InternetShortcut][]URL="
address+"[]"

out name
out address

address.setfile(name)

Or use this function.
Function CreateInternetShortcut
Code:
Copy      Help
;/
function $urlFile $urlTarget

Wsh.WshShell sh._create
Wsh.WshURLShortcut us=sh.CreateShortcut(_s.expandpath(urlFile))
us.TargetPath=urlTarget
us.Save

example
Macro Macro1196
Code:
Copy      Help
CreateInternetShortcut "$desktop$\yahoo.url" "http://my.yahoo.com/"
#5
This probably isn't as slick as something the Ginmaster could create, but this works pretty well for me as a replacement for the old Deskcut add on for Firefox. I actually like it better. You can select the name for the shortcut from text on the page or just type it in (ie, remember to fill out this form).

Macro Desktop Internet Shortcut
Code:
Copy      Help
str name.getsel
if(name.len=0)
,str typedname
,if(!inp(typedname "Please enter a name for the shortcut." "Desktop Shortcut")) ret
,name=typedname

str unmodified=name
name-"$desktop$\"
name+".url"

Acc a=acc("Search Bookmarks and History" "TEXT" win("" "MozillaUIWindowClass") "MozillaUIWindowClass" "" 0x1801 0x0 0x20000040)
str address=a.Value

CreateInternetShortcut name address
mes("A shortcut has been created for: %s" "Desktop Shortcut" "s" unmodified)


Forum Jump:


Users browsing this thread: 1 Guest(s)