33// Required parameters:
44// @raycast .schemaVersion 1
55// @raycast .title Copy Markdown URL and Title
6- // @raycast .mode compact
6+ // @raycast .mode silent
77//
88// Optional parameters:
99// @raycast .packageName Copy Markdown URL and Title
1313// @raycast .description Copy URL and title from the current browser as markdown.
1414// @raycast .author Jakub Chodorowicz
1515// @raycast .authorURL https://github.com/chodorowicz
16+ // script version 1.1
1617
1718const systemEvents = Application ( "System Events" ) ;
1819const frontProcess = systemEvents . processes . whose ( { frontmost : true } ) [ 0 ] ;
@@ -31,7 +32,9 @@ const chromiumBrowsers = [
3132 "Vivaldi" ,
3233] ;
3334const webkitBrowser = [ "Safari" , "Webkit" ] ;
34- const theRest = [ "Firefox" ] ;
35+ // Arc fails when trying to run JXA automation on it (📆 2023-07-29)
36+ // so we're using here traditional systemEvents approach
37+ const theRest = [ "Firefox" , "Arc" ] ;
3538
3639if ( chromiumBrowsers . includes ( appName ) ) {
3740 const activeWindow = Application ( appName ) . windows [ 0 ] ;
@@ -56,12 +59,11 @@ if (webkitBrowser.includes(appName)) {
5659
5760if ( theRest . includes ( appName ) ) {
5861 systemEvents . keystroke ( "l" , { using : "command down" } ) ;
59- delay ( 0.1 ) ;
62+ delay ( 0.2 ) ;
6063 systemEvents . keystroke ( "c" , { using : "command down" } ) ;
61- delay ( 0.1 ) ;
62- /// escape 2x - clear the selection of address bar
63- // systemEvents.keyCode(53);
64- // systemEvents.keyCode(53);
64+ delay ( 0.2 ) ;
65+ /// escape clear the selection of address bar
66+ systemEvents . keyCode ( 53 ) ;
6567 url = app . theClipboard ( ) ;
6668 title = frontProcess
6769 . windows ( )
0 commit comments