Posts: 45
Threads: 10
Joined: Jul 2006
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
Posts: 12,072
Threads: 140
Joined: Dec 2002
Macro
Macro1185
str s=
;[InternetShortcut]
;URL=http://www.quickmacros.com/forum/viewtopic.php?p=17612
s.setfile("$desktop$\zxcv.url")
Posts: 45
Threads: 10
Joined: Jul 2006
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.
;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)
Posts: 12,072
Threads: 140
Joined: Dec 2002
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
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
;/
function $urlFile $urlTarget
Wsh.WshShell sh._create
Wsh.WshURLShortcut us=sh.CreateShortcut(_s.expandpath(urlFile))
us.TargetPath=urlTarget
us.Save
example
Macro
Macro1196
CreateInternetShortcut "$desktop$\yahoo.url" "http://my.yahoo.com/"
Posts: 45
Threads: 10
Joined: Jul 2006
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
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)