set weblocs_in_folder to every paragraph of (do shell script "ls " & (quoted form of POSIX path of (choose folder) & "*.webloc"))
set myurls to {}
set url_texts to {}
repeat with current_webloc in weblocs_in_folder
set myurls to myurls & geturlfromwebloc(current_webloc)
set url_texts to url_texts & ((characters 1 through (-1 * (count of ".webloc") - 1) of (do shell script "basename " & quoted form of current_webloc)) as text)
end repeat
set htmltext to "<ul>"
repeat with i from 1 to count of myurls
set htmltext to htmltext & "<li><a href=\"" & item i of myurls & "\" target=\"_blank\" rel=\"nofollow external\">" & item i of url_texts & "</a></li>"
set htmltext to htmltext & "</ul>" as text
set the clipboard to htmltext
on geturlfromwebloc(weblocpath)
set weblocpath to quoted form of ((POSIX path of weblocpath) & "/rsrc")
set cmd to "strings " & weblocpath & " | grep http | sed '/^.http/s//http/' | head -1"
set cmd to cmd as «class utf8»
set weblocurl to do shell script cmd
return weblocurl
end geturlfromwebloc
Your email is never published nor shared. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
CAPTCHA: three + 6 =
Notify me of followup comments via e-mail
Subscribe without commenting E-Mail:
Und wie baue ich mir meine Linkliste?
set weblocs_in_folder to every paragraph of (do shell script "ls " & (quoted form of POSIX path of (choose folder) & "*.webloc"))
set myurls to {}
set url_texts to {}
repeat with current_webloc in weblocs_in_folder
set myurls to myurls & geturlfromwebloc(current_webloc)
set url_texts to url_texts & ((characters 1 through (-1 * (count of ".webloc") - 1) of (do shell script "basename " & quoted form of current_webloc)) as text)
end repeat
set htmltext to "<ul>"
repeat with i from 1 to count of myurls
set htmltext to htmltext & "<li><a href=\"" & item i of myurls & "\" target=\"_blank\" rel=\"nofollow external\">" & item i of url_texts & "</a></li>"
end repeat
set htmltext to htmltext & "</ul>" as text
set the clipboard to htmltext
on geturlfromwebloc(weblocpath)
set weblocpath to quoted form of ((POSIX path of weblocpath) & "/rsrc")
set cmd to "strings " & weblocpath & " | grep http | sed '/^.http/s//http/' | head -1"
set cmd to cmd as «class utf8»
set weblocurl to do shell script cmd
return weblocurl
end geturlfromwebloc