-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a552400
commit 63bb077
Showing
4 changed files
with
89 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
-- this subroutine will get every action of the front macro, even those nested | ||
-- within control statements and groups | ||
|
||
global allActions | ||
set allActions to {} | ||
tell application "Keyboard Maestro" | ||
set m to first macro whose selected is true | ||
my getAllActions(m's actions) | ||
end tell | ||
|
||
on getAllActions(actionList) | ||
local actionList | ||
tell application "Keyboard Maestro" | ||
get class of actionList | ||
if (class of actionList = list or ¬ | ||
class of actionList = action list) and ¬ | ||
(count of items of actionList) > 0 then | ||
|
||
repeat with act in actionList | ||
my getAllActions(act) | ||
end repeat | ||
|
||
else if class of actionList = case entry then | ||
|
||
if (count of actionList's actions) > 0 then | ||
my getAllActions(actionList's actions) | ||
end if | ||
|
||
else if class of actionList = action then | ||
|
||
--set end of allActions to actionList | ||
set end of allActions to a reference to contents of actionList | ||
|
||
-- groups | ||
try | ||
if (count of actionList's actions) > 0 then | ||
my getAllActions(actionList's actions) | ||
end if | ||
end try | ||
-- switch statements | ||
try | ||
if (count of actionList's case entries) > 0 then | ||
my getAllActions(actionList's case entries) | ||
end if | ||
end try | ||
--if then actions | ||
try | ||
if actionList's thenactions ≠ missing value then | ||
my getAllActions(actionList's thenactions's actions) | ||
end if | ||
end try | ||
-- if else actions | ||
try | ||
if actionList's elseactions ≠ missing value then | ||
my getAllActions(actionList's elseactions's actions) | ||
end if | ||
end try | ||
|
||
end if | ||
|
||
end tell | ||
end getAllActions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters