applescript

Applescript | Javascript - Click on Link using Javascript?

时光怂恿深爱的人放手 提交于 2019-12-08 06:38:05
问题 I am trying to get applescript to click on the (link), I have posted the code below, i have tried many ways but i am unable to get it work. Also the link is different every time so i cant just copy that link into it. Thanks in advanced! Also This is all the code to do with it (I think) i want it to click on the date of last upload: (Link) <div class="span4 offset1"> <ul class="unstyled"> <li>Monthly Views: <strong class="pull-right"><a href="#" class="data-na" data-original-title="" title=""

change screen resolution with AppleScript

て烟熏妆下的殇ゞ 提交于 2019-12-08 06:35:51
问题 I am trying to click at radio buttons in Displays panel of System Prefernces, namely to change Screen resolution. This is the code I use to identify radio buttons: tell application "System Preferences" activate reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays" end tell tell application "System Events" tell application process "System Preferences" set frontmost to true get every radio button of window 0 --click button 1 of window 0 of application process "System

Running Applescript from a Cocoa application

我与影子孤独终老i 提交于 2019-12-08 06:31:49
问题 I want to run a simple applescript in a cocoa application. I read the apple documentation on the matter but it was too confusing for me (a beginner) to understand. tell application "iTunes" to play 回答1: Per the documentation, you use the NSAppleScript class. The very short API reference has a section called "Initializing a Script," one method of which is -initWithSource: , which takes an NSString. You'll create your object this way. Once you have your script object, you can then either

Is there a way to trigger a Hot Key/Keyboard Shortcut via a Shell Script, a AppleScript or a Automator Workflow?

眉间皱痕 提交于 2019-12-08 05:17:21
问题 I'm an avid Keyboard Maestro user and I need a workaround for triggering a keyboard shortcut like ⌘⇧L (externally, without Keyboard Maestro). So I thought a bash script would be capable of doing such a thing. An AppleScript or an Automator workflow would be sufficient, too. I anybody could help me this would be great. You don't have to read this, but here's why I want to do what I want to do: I have a the same string assigned to various Markdown macros, I use a string instead of Hotkeys

Tap AppleEvents being sent to another application

让人想犯罪 __ 提交于 2019-12-08 05:03:30
Is it possible to monitor or tap the stream of Apple Events being sent to a process, in the same way you can tap Quartz Events? I have an application that talks to another application to force it to import files, but it does so in a way that's unavailable through menus or UI scripting, and I'm trying to track down how it does this. Do you need to do this programmatically or is manual/interactive OK? If manual is OK, here are some approaches: Try using AppleScript Editor to record the target app. Try using the techniques listed in Technical Note TN2124: Mac OS X Debugging Magic under Apple

How do I remove a build configuration from an Xcode project from a script?

老子叫甜甜 提交于 2019-12-08 04:50:54
问题 I'm currently using AppleScript to clean up an Xcode project. I'd like my script to remove some build configurations that won't be relevant to other developers on my team. For example, if I have "Debug", "DebugTest", and "Release", I would like the script to remove "DebugTest". I'm currently using the following script: tell application "Xcode" open myXcodeProject set targetProject to project of active project document set targetConfigurations to build configurations of targetProject repeat

How can I make applescript voice recognition listen for any word?

微笑、不失礼 提交于 2019-12-08 04:39:21
问题 How can I make applescript voice recognition listen for any word? This is what I have so far: tell application "System Events" keystroke "c" using {command down} end tell tell application "iCal" to activate tell application "System Events" keystroke "n" using {command down} keystroke "v" using {command down} keystroke return end tell I would like to substitute the copy on the first line to listen for any words. 回答1: tell application "SpeechRecognitionServer" set answer to listen for {"yes",

Click on safari web page button using AppleScript

二次信任 提交于 2019-12-08 04:28:27
问题 I'm trying to figure out how to click on the button in a webpage. For example click on the "I'm Feeling Lucky" button in google web page. This is what I have tried: tell application "Safari" make new document with properties {URL:"https://www.google.com/"} do JavaScript "eval(document.getElementById('I'm Feeling Lucky').parentNode.href.substring(11))" in document 1 delay 1 end tell But it doesn't work. Any of you knows how can I click on the button using applescript? I'll really appreciate

Make MIMETYPE file the first file in an EPUB ZIP file?

て烟熏妆下的殇ゞ 提交于 2019-12-08 04:18:42
问题 My goal is to create an EPUB file via an AppleScript, and I'm starting with semi-manually generating an EPUB file. My issue is that the IDPF EPUB validator reports that my MIMETYPE file isn't isn't the first file in my EPUB package or that my MIMETYPE doesn't exist. My AppleScript is creating the EPUB folder structure and a MIMETYPE file: set EPUBMIMETYPEfilepath to ((EPUBfolderPath & ":MIMETYPE") as string) set referenceToEPUBMIMETYPEfile to a reference to file EPUBMIMETYPEfilepath open for

Active Chat Received Message Applescript Handler gets runs twice, anybody know why?

白昼怎懂夜的黑 提交于 2019-12-08 04:09:24
问题 Please can anyone help me with the below issue: Active Chat Message Handler in Applescript for Messages app runs twice, looks like it receives the message twice, has anyone else seen this issue? below is my code: global myBuddysName global textmsg on readFile(unixPath) set foo to (open for access (POSIX file unixPath)) set txt to paragraphs of (read foo for (get eof foo)) close access foo return txt end readFile on msgImage(unixPath) tell application "Finder" set randomFile to (some file of