applescript

Using Applescript to Execute a Complicated Keystroke

a 夏天 提交于 2019-12-30 02:42:07
问题 I'm trying to write an Applescript in Automator that will press the left arrow button while holding down control, option, and command. The code I have so far is: on run {input, parameters} tell application "System Events" tell application "Sublime Text 2" to activate keystroke "left" using {control down, option down, command down} end tell return input end run However, this is not working. Any suggestions as to how to fix this code? Thanks! 回答1: When using arrow keys you need to target them

How to make the hardware beep sound in Mac OS X 10.6

浪尽此生 提交于 2019-12-29 10:09:54
问题 I just want that Mac OS X 10.6 does a hardware beep sound like in open suse and other distributions. I tried following approaches Terminal -> beep = -bash: beep: command not found Terminal -> say beep = voice speaks out beep (Not a Hardware beep but awesome ;) ) applescript -> beep = Macintosh bell (I want a Hardware beep!) Does anybody know how to make the Hardware beep in bin/bash or applescript? 回答1: There is no "hardware beep" in macOS. The functionality you're thinking of is an artifact

how to get windowid from applescript

时光怂恿深爱的人放手 提交于 2019-12-29 07:23:10
问题 I am trying to get window id of of every window. set r to {} tell application "System Events" repeat with t in windows of processes set sid to id of t set end of r to {title:title of t, id:sid} end repeat end tell r The above code returns error "System Events got an error: Can’t get id of item 1 of every window of every process." number -1728 from id of item 1 of every window of every process How to get the window id of every window? 回答1: I wrote a little Objective-C program for you that gets

Mac OS app based on Applescript

*爱你&永不变心* 提交于 2019-12-25 18:32:16
问题 I'm new to Xcode as well as I am to AppleScript All I need is to run an AppleScript in an Xcode application. Bassically, the application is downloading pictures from a url list in Excel and renames the files acording the list in Excel Here is the applescript code : tell application "Microsoft Excel" set filenames to value of every cell of range "K3:K200" of sheet "Image_Moves" of document 1 set URLs to value of every cell of range "L3:L200" of sheet "Image_Moves" of document 1 end tell repeat

How to check the location of download folder programmatically in browsers like Safari, Firefox etc on Mac?

你说的曾经没有我的故事 提交于 2019-12-25 18:14:55
问题 I am a part of Automation testing and I am downloading and installing the files programmatically with Selenium and Applescript on Mac. Is their any way to check the location of download folder on browsers programmatically?? if so pls suggest and also ways to change the location of download folder in Java or Applescript. 回答1: Safari has a preference for it in ~/Library/Preferences/com.apple.Safari.plist: defaults read com.apple.Safari DownloadsPath You can also change it by modifying the

Applescript System Events Returns .DS_Store - How can I ignore

泄露秘密 提交于 2019-12-25 13:37:14
问题 I have looked around on the net for hours looking for this answer so I apologize if its there somewhere. This script below works fine except for the fact that it returns the .DS_Store file how can I exclude it from this query and all other hidden files for that matter but because I am creating the folder in my script the only one there is .DS_Store tell application "System Events" set listOfInputs to POSIX path of every disk item of folder a as list end tell Here is the full script below. I

How to download a new voice for say's function with AppleScript?

自作多情 提交于 2019-12-25 11:48:12
问题 I'm searching a method to install different voices (2 to be exact) on the system preferences. The voices are "Alex" for an english voice and "Thomas" for a french voice. I've tried directly by console but didn't succeed, that's why I've turned to the AppleScript language, but I never used this language. The code I've for the moment is set osver to system version of (system info) if osver is equal to "10.6.8" then display dialog ("Downloading voices is only available in OS X Lion and higher")

How to download a new voice for say's function with AppleScript?

扶醉桌前 提交于 2019-12-25 11:48:09
问题 I'm searching a method to install different voices (2 to be exact) on the system preferences. The voices are "Alex" for an english voice and "Thomas" for a french voice. I've tried directly by console but didn't succeed, that's why I've turned to the AppleScript language, but I never used this language. The code I've for the moment is set osver to system version of (system info) if osver is equal to "10.6.8" then display dialog ("Downloading voices is only available in OS X Lion and higher")

Pass variable into AppleScript from python

我与影子孤独终老i 提交于 2019-12-25 08:47:48
问题 Can someone show me how to pass a variable into an Applescript using osascript in python? I've seen some documentation/samples on doing this but I'm not understanding it at all. Here is my python code: # I want to pass this value into my apple script below myPythonVariable = 10 cmd = """ osascript -e ' tell application "System Events" set activeApp to name of first application process whose frontmost is true if "MyApp" is in activeApp then set stepCount to myPythonVariableIPassIn repeat with

how to invoke an applescript from the lock screen?

蹲街弑〆低调 提交于 2019-12-25 07:18:29
问题 I would like to know how to invoke an applescript from the lock screen. I am using Hammerspoon for hotkey triggering. So I am kind of thinking of automating login using hotkeys if not using hammerspoon is there anyother ways? Any suggestion is appreciated 来源: https://stackoverflow.com/questions/39434036/how-to-invoke-an-applescript-from-the-lock-screen