3
3
// Required parameters:
4
4
// @raycast .schemaVersion 1
5
5
// @raycast .title Copy Markdown URL and Title
6
- // @raycast .mode compact
6
+ // @raycast .mode silent
7
7
//
8
8
// Optional parameters:
9
9
// @raycast .packageName Copy Markdown URL and Title
13
13
// @raycast .description Copy URL and title from the current browser as markdown.
14
14
// @raycast .author Jakub Chodorowicz
15
15
// @raycast .authorURL https://github.com/chodorowicz
16
+ // script version 1.1
16
17
17
18
const systemEvents = Application ( "System Events" ) ;
18
19
const frontProcess = systemEvents . processes . whose ( { frontmost : true } ) [ 0 ] ;
@@ -31,7 +32,9 @@ const chromiumBrowsers = [
31
32
"Vivaldi" ,
32
33
] ;
33
34
const 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" ] ;
35
38
36
39
if ( chromiumBrowsers . includes ( appName ) ) {
37
40
const activeWindow = Application ( appName ) . windows [ 0 ] ;
@@ -56,12 +59,11 @@ if (webkitBrowser.includes(appName)) {
56
59
57
60
if ( theRest . includes ( appName ) ) {
58
61
systemEvents . keystroke ( "l" , { using : "command down" } ) ;
59
- delay ( 0.1 ) ;
62
+ delay ( 0.2 ) ;
60
63
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 ) ;
65
67
url = app . theClipboard ( ) ;
66
68
title = frontProcess
67
69
. windows ( )
0 commit comments