• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App


  • Subject: Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App
  • From: David Gregg <email@hidden>
  • Date: Thu, 30 Mar 2017 08:07:10 -0600

Jim,

Sorry, a slight mistake, you need to replace the right square bracket in the goToPreviousTab() handler with the left square bracket.

Notes:
1) The System Events scripting could also be done with Keyboard Maestro macro commands (keyboard shortcuts or menu selection) as well.
2) The value for currentTab could also be saved to a file in Script #1 and retrieved in Script #2.

David


> -- Script #2
>
> on toggleRecentTwoTabs(tabList)
> 	tell application "Script Debugger"
> 		set currentTab to name of (current document of script window 1)
> 	end tell
> 	tell application "Keyboard Maestro Engine"
> 		set firstTab to getvariable "FirstTab"
> 	end tell
> 	if currentTab = firstTab then
> 		my goToNextTab()
> 	else
> 		my goToPreviousTab()
> 	end if
> end toggleRecentTwoTabs
>
> on goToNextTab()
> 	tell application "System Events"
> 		tell process "Script Debugger"
> 			keystroke "]" using {command down, option down}
> 			delay 0.5
> 		end tell
> 	end tell
> end goToNextTab
>
> on goToPreviousTab()
> 	tell application "System Events"
> 		tell process "Script Debugger"
> 			keystroke "]" using {command down, option down}

should be the left square bracket, not the right one...
keystroke"[" using {command down, option down}

> 			delay 0.5
> 		end tell
> 	end tell
> end goToPreviousTab
>
>
>>
>> Best Regards,
>>
>> Jim Underwood
>> aka JMichaelTX
>>
>>
>> From: David Gregg <email@hidden>
>> Date: Wed, Mar 29, 2017 at 5:19 PM
>> To: JMichael <email@hidden>
>> Cc: "ASUL (AppleScript)" <email@hidden>
>> Subject: Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App
>>
>> Jim,
>>
>> I believe this will handle the window toggling.
>>
>> tell application "System Events"
>> set frontmostApp to name of first item of (processes whose frontmost is true)
>> tell process frontmostApp
>> set value of attribute "AXMain" of window 2 to true
>> end tell
>> end tell
>>
>> David
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> AppleScript-Users mailing list      (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> Archives: http://lists.apple.com/archives/applescript-users
>>
>> This email sent to email@hidden
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


References: 
 >Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App (From: Jim Underwood <email@hidden>)
 >Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App (From: David Gregg <email@hidden>)
 >Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App (From: Jim Underwood <email@hidden>)
 >Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App (From: David Gregg <email@hidden>)

  • Prev by Date: Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App
  • Next by Date: Re: How Many People on the ASUL use UI Browser?
  • Previous by thread: Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App
  • Next by thread: Re: Looking for Scripts, Snippets, Ideas for Toggling Windows and Tabs of an App
  • Index(es):
    • Date
    • Thread