I had a script where it would list all current safari tabs then brought up the selector to choose what group I wanted to save the URL list to. Somehow lost it with recent mac reformat.
Anybody has the same script or similar
Thank you.
I had a script where it would list all current safari tabs then brought up the selector to choose what group I wanted to save the URL list to. Somehow lost it with recent mac reformat.
Anybody has the same script or similar
Thank you.
Found it.
Could you post it? May be interesting for other users.
Here it is, but I think you already have it.
Also Import>Destination>select group must be checked.
sorry this stupid thing never works. back tick to enclosed the script?
set urlList to {}
set the date_stamp to ((the current date) as string)
set NoteTitle to "URL List from Safari Tabs on " & the date_stamp
--PROCESS TABS OF FRONTMOST SAFARI WINDOW
tell application "Safari"
activate
set safariWindow to the front window
set successCount to 0
set tabCount to (count of (tabs of safariWindow))
repeat with w in safariWindow
--GET TAB INFORMATION
try
repeat with t in (tabs of w)
set TabTitle to (name of t)
set TabURL to (URL of t)
set TabInfo to ("<a href=\"" & TabURL & "\">" & TabTitle & "</a><br/>")
--COPY TAB INFO TO END OF LIST
copy TabInfo to the end of urlList
--INCREMENT SUCCESS COUNT
set successCount to (successCount + 1)
end repeat
end try
end repeat
end tell
--CONVERT LIST TO TEXT
set old_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to return
set url_list to urlList as text
set AppleScript's text item delimiters to old_delim
--MAKE THE ITEM IN DEVONthink Pro
tell application "DEVONthink 3"
create record with {type:html, source:url_list, name:NoteTitle}
end tell
--NOTIFY RESULTS
my notification_Center(successCount, tabCount)
(*
======================================
// NOTIFICATION SUBROUTINE
======================================
*)
--NOTIFICATION CENTER
on notification_Center(successCount, itemNum)
set Plural_Test to (successCount) as number
if Plural_Test is -1 then
display notification "No Tabs Exported!" with title "Send Safari Tabs to DEVONthink 3"
else if Plural_Test is 0 then
display notification "No Tabs Exported!" with title "Send Safari Tabs to DEVONthink 3"
else if Plural_Test is equal to 1 then
display notification "Successfully Exported " & itemNum & ÂŹ
" Tab to DEVONthink 3" with title "Send Safari Tabs to DEVONthink 3" subtitle "â
"
else if Plural_Test is greater than 1 then
display notification "Successfully Exported " & itemNum & ÂŹ
" Tab to DEVONthink 3" with title "Sent Safari Tabs to DEVONthink 3" subtitle "â
"
end if
set itemNum to "0"
delay 1
end notification_Center
Yes, wrap the script in three backticks, like this
```
script
```
Note: You have to paste it again as plain text as the previous version without backticks is messed up.
Done but this time it worked with just the 3 ticks at the beginning. I didnât inclosed it
Ticks
script
Ticks
I did this ```script
No idea why. Thanks, thatâs a nice script, didnât have something like that.
However I wonder what this is meant for:
in "/path/to/December 2018"
ha sorry that I edited for my folder but even with that on, it seems like it doesnât affect it. that folder was from 2018 but I donât have that folder anymore. I think I should delete that part.
this scripts sends the ULRs to another folder I have specified in smart rules.
I took this out
tell application âDEVONthink 3â
create record with {type:html, source:url_list, name:NoteTitle} in â/path/to/December 2018â
end tell
and it just saves the URL to inbox and it prompts the notification. IT DOESNT bring up the group selector.
and if you delete this.
-in â/path/to/December 2018â-
it brings up the gourd selector.
Works over here. I saw why you have difficulties with the backticks. For multi-line code they need to be one line above and one line below the actual code.
This works:
```
line 1
line 2
```
This doesnât work:
```line 1
line2```
Ah I see. thanks for the heads up.
BTW do you happen to know how do I include a shorcutkey to that script? for Safari?
No is not what you are thinking.
I want to execute a shortcut key for Safari first but in a script form. then have that code added to the script above.
You need an app that executes AppleScripts. I can recommend Alfred.app, however itâs not free.
FastScripts.app seems to be free for up to 10 shortcuts but I never used it. FastScripts