applescript

Python: Activate window in OS X

不打扰是莪最后的温柔 提交于 2020-07-19 11:07:12
问题 I'm running OS X 10.11 , and I have created a web scraper using Python and Selenium . The scraper uses Firefox as the browser to collect data. The Firefox window must remain active at all critical steps, for the scraper to work. When I leave the computer with Firefox as the active window, when I return I often find that the active window focus has changed to something else. Some process is stealing the window focus. Is there a way that I can programatically tell the OS to activate the Firefox

Applescript “Google Chrome got an error: Can’t make |tabs| of window id 1 into type specifier.”

依然范特西╮ 提交于 2020-07-09 11:54:47
问题 New to Applescript. Trying to make a script that will cycle through my tabs, printing each tab to PDF. Starting from here... Example of working Google Chrome Applescript ...but trying to generalize to work with all of Google Chrome, Firefox, and Safari. To start this modification, I began by looking here and here. I'm getting tripped up right off the bat, noticing that a small change can make a big difference ... NO ERROR: tell application "Google Chrome" set myWindow to front window set

Change icon of notification when using osascript -e “display notification”

风流意气都作罢 提交于 2020-07-06 11:58:26
问题 I'm trying to write a plugin for emacs that displays a notification using OS X's native notification display. I've run into terminal-notifier which works, but it's a dependency that doesn't work on every mac. Plus the user should be made aware that they need to install the package. What I want to do is call a process osascript -e and make it display the notification. The problem is, the only way to change its icon is from an external bundle. Is there any way to make osascript -e display what

Using AppleScript to modify settings/system preferences

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-28 09:34:05
问题 I am trying to make an AppleScript that toggles automatic rearranging of spaces. I am able to get the AppleScript to open system preferences and go into mission control settings, however i am not sure how to check the box which i want to change. tell application "System Preferences" activate end tell tell application "System Events" tell process "System Preferences" click menu item "Mission Control" of menu "View" of menu bar 1 delay 2 tell window "Mission Control" //additional code goes here

Is there a quick and easy way to dump the contents of a MacOS X keychain?

拟墨画扇 提交于 2020-06-24 01:34:39
问题 I'm looking for a way to dump (export) the contents of an OS X keychain into a file that I can easily process elsewhere, such as tab-delimited plaintext or something of the sort. The Keychain Access app does not offer any such functionality, and getting a key's data involves opening each in turn, and having to type in the keychain's password to see the password stored with the key, every time. After a bit of digging, I found somebody's solution by using AppleScript and the Keychain Scripting

Is there a quick and easy way to dump the contents of a MacOS X keychain?

隐身守侯 提交于 2020-06-24 01:34:36
问题 I'm looking for a way to dump (export) the contents of an OS X keychain into a file that I can easily process elsewhere, such as tab-delimited plaintext or something of the sort. The Keychain Access app does not offer any such functionality, and getting a key's data involves opening each in turn, and having to type in the keychain's password to see the password stored with the key, every time. After a bit of digging, I found somebody's solution by using AppleScript and the Keychain Scripting

Replacing invalid characters in the filename with dashes using AppleScript

爱⌒轻易说出口 提交于 2020-06-17 10:05:33
问题 My goal is to create service in Automator using AppleScript or Javascript which replaces all invalid characters of selected filename ()[\\/:"*?<>|]+_ and spaces with dashes ( - ) and make filename lowercase. 回答1: The replacement of impermissible characters in a file/folder name can be achieved by utilizing a Bash Shell script in your Automator Service. The following steps describe how to achieve this: Configuring Automator Launch Automator Type ⌘N , or choose File > New from the Menu bar.