Skip to content

Commit

Permalink
Merge pull request #6 from CeQadrat/master
Browse files Browse the repository at this point in the history
Fixed working on Mac
  • Loading branch information
akostiv authored Mar 23, 2018
2 parents 3a88691 + c290d2c commit 5a31644
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "active-window",
"version": "0.2.0",
"version": "0.2.1",
"description": "Get active window title.",
"main": "index.js",
"contributors": [
Expand Down
8 changes: 5 additions & 3 deletions scripts/mac.scpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ tell application "System Events"
set frontApp to first application process whose frontmost is true
set frontAppName to name of frontApp
tell process frontAppName
tell (1st window whose value of attribute "AXMain" is true)
set windowTitle to value of attribute "AXTitle"
end tell
if exists 1st window whose value of attribute "AXMain" is true then
tell (1st window whose value of attribute "AXMain" is true)
set windowTitle to value of attribute "AXTitle"
end tell
end if
end tell
end tell
return {frontAppName,windowTitle}

0 comments on commit 5a31644

Please sign in to comment.