applescript

Creating Outlook Contacts via Applescript

ε祈祈猫儿з 提交于 2019-12-25 06:59:46
问题 I'm trying to create an Outlook contact via Applescript. The script looks like this: tell application "Microsoft Outlook" to make new contact with properties {first name:"test1", last name:"test2", email addresses:{{address:"work@mywork.com", type:work}, {address:"home@myhome.com", type:home}}} The Outlook dictionary tells me that I got the class name ("contact") and the field names right. But upon saving the script I'm told: expected class name, but got property and the first "name" is

Cocoa application contains no menu bars, according to AppleScript

假装没事ソ 提交于 2019-12-25 05:46:10
问题 I am creating a mac app that needs to start dictation (OSX 10.8) by itself. Because there is no way to initiate dictation "directly" the best way to do this is through the menu bar "Edit"/"Start Dictation" because a user may have different keyboard shortcuts for it. Here's the simple script my app calls (using an NSAppleScript object): tell application "System Events" tell application process "MyApp" tell menu bar 1 tell menu bar item "Edit" tell menu "Edit" click menu item "Start Dictation"

Applescript Syntax (Multiple Args) Inside Objective-C File

谁说我不能喝 提交于 2019-12-25 05:31:39
问题 I have been working on trying to run an Applescript from within Objective-C that queries out to the terminal to run some shell commands. I am running into an issue with how to format the command within Objective-C, so that the script object gets referenced properly. This is what the script looks like as an applescript set thisFile to "Dev1.4" set testTarget to "/Users/lab/Desktop/untitled" do shell script "/Users/lab/Desktop/TempRoot/myCommand.command " & thisFile & space & testTarget with

How to resize a Keynote slideshow?

独自空忆成欢 提交于 2019-12-25 05:29:14
问题 I'm an absolute newbie with Applescript but I need to know, first of all, if is it possible to launch a Keynote Slideshow and then how to resize that slideshow to a particular dimension and rect on the desktop. I know you to start a slideshow. I Know how to resize a window with set the bounds of the window 1 to {0, 0, 200, 400} but don't know how to pass this command to the Keynote slideshow, if it is possible.. Any hints?? 回答1: You can resize the windows of any application by using a 'tell'

Clicking an UI unknown element: I'm getting “missing value”

那年仲夏 提交于 2019-12-25 05:22:43
问题 I'm a newbie in applescripting: I've used UI Browser to find an element of a process I'd like to click. I've found that the element I wanna click is "UI element 10" This is what I've come with: tell application "System Events" tell application process "nameofmyapp" to tell window 1 click UI element 10 end tell end tell But it returns: "missing value". How can I solve this? 回答1: System Events has problems sometimes clicking buttons, mostly on non-native cocoa application windows. Is that your

Why won't this short bit of code work?

☆樱花仙子☆ 提交于 2019-12-25 05:15:12
问题 Just a quick question: What's wrong with the following AppleScript code? What it's supposed to do is get the position of a text item (separated by a user-provided delimiter) within a string. But thus far, it doesn't work. Script Debugger simply says, "Can't continue return_string_position" without any specific errors. Any ideas as to what's wrong? tell application "System Events" set the_text to "The quick brown fox jumps over the lazy dog" set word_index to return_string_position("jumps",

Learning Applescript: Trouble linking to Safari

拟墨画扇 提交于 2019-12-25 05:07:47
问题 Run Down Hello, this is a very specific and situation question. Basically, I'm running Applescript in Automator on Safari, and the result is Null. What I Have I currently have a script that can do these things: Before I even run the Automator program, I have Safari open Next I run the Automator, which starts with this code: on run {input, parameters} tell application "Safari" to activate tell application "System Events" keystroke "t" using command down end tell return input end run This

Set command in the middle of do shell script

痞子三分冷 提交于 2019-12-25 04:57:12
问题 I have been attempting to make a simple application that copies a selected file to a predetermined directory, only the variable does not work when set in a shell script. I was wondering if there is a way to phrase the copy or move command to allow it to take effect. The script is below. set filepath to POSIX path of (choose file with prompt "Chose your file") delay do shell script "cp " & filepath & " ~/Library/Application Support/" 回答1: It does not work because space characters in paths must

Click Button on Webpage with Applescript/JavaScript

﹥>﹥吖頭↗ 提交于 2019-12-25 04:09:27
问题 I have found several other similar questions, but none of them solve the precise problem I need to solve. I am attempting to simulate a mouse click, to get the entire results of a scroll (e.g., from this site: http://www.deadseascrolls.org.il/explore-the-archive/manuscript/4Q266-1) visible. I specifically want to "click" on the "Load More Results" item at the bottom centre of displayed images (but I think this made more difficult because of the source encoding at the site). I would like to

AppleScript changes to Outlook messages are not saved

元气小坏坏 提交于 2019-12-25 04:08:56
问题 I am forced to use Outlook for Mac connected to corporate Exchange at work and I have pieced together a small AppleScript to alter subject lines of incoming email messages from our monitoring system. By default they are of an ungodly length and not human readable. I am attempting to fix that. The script works, but for some strange reason everything is working great when I send test messages myself, however all changes are reverted back when the real messages from the monitoring system come in