I've googled & searched the site for this with no luck, and you guys were such great help last time. I was hoping someone might have an idea of how to change the current users iMessage icon through Applescript? I have looked through the Messages suite under the applescript library and found that there under the class 'application' there is a property 'image'. The description of which is "My image as it appears in all services". It does not appear to be read only.
I am trying to change that property, but in my limited knowledge of Applescript it does not appear to be working. Here's what I've got:
tell application "Messages"
set image to NewImage
end tell
NewImage in this case is a POSIX file path (which I'm not sure is right either) ;\
(OSX Yosemite by the way)
Thanks :]
Related
I am trying to change the window title text on my Mac with Applescript.
I followed this post Rename window title in OS X with AppleScript or terminal, but it did not change the text of the Telegram app window title and gives this error: Syntax Error: A property can’t go after this identifier.
I used this script:
tell application "Telegram"
set custom title of window 1 to "I want to change this"
end tell
Can someone find a solution to my problem?
Telegram does not include even the most rudimentary AppleScript support, sorry to say.
Scanning the internet I found that in the past one could set the view scale or fit width of an iWorks application like this in Applescript:
tell window 1 of application "Keynote"
set fit width to true
end tell
or
tell window 1 of application "Keynote"
set view scale to 80
end tell
Both these methods don't work in Yosemite anymore (and most likely did not work since Snow Leopard according to some Google searches.
I also looked through the Applescript API Library for Keynote and could not see anything that refers to a view scale or zoom level.
Is there really no way anymore to set these via AppleScript?
My end goal is actually just to have new iWorks apps always be set to "Fit in Window", but lacking the possibility to set and save it via a Theme, I was assuming that AppleScript would be the only possible solution.
I am working on an AppleScript to toggle between minimize and maximize of specific windows. I have it working pretty well. But I am running into a specific issue with one application the MOG app for Mac does not seem to have a variable for miniaturize, collapse, or minimize.
I know that I could use click to toggle the window, but I would prefer a solution that works with the API.
Here is the applescript just for MOG:
tell application "MOG"
set (miniaturized of windows whose miniaturizable is true) to true
end tell
I would really appreciate it if someone could point me in the right direction.
Not every application is going to allow something like miniaturization of windows via AppleScript, even when the application is scriptable. One way to find out the properties of an application's window:
tell application "MOG"
get properties of window 1
end tell
You can also open the MOG dictionary and find out what you're able to script. Pressing cmd-shift-o will open a window listing all applications' scripting dictionaries.
I am trying to install the downloaded application programatically, hence I am using apple script for the same since am working on Mac.
Here I've downloaded the Adobe AIR Installer app from adobe site which is in downloads folder and am trying to install the same with the below applescript code. Here when the Adobe AIR setup dialog box opens, I need to click on "I Agree" button to install the app.
With the below code am not able to click on the "I Agree" button, even i dont have Xcode Accessibility Inspecter do inspect the element. Pls guide me the script to handle the "I agree" button.
try
tell application "Finder"
activate
open application file "Adobe AIR Installer.app" of folder "Applications" of startup disk
set this_image to open this_file
delay 5
tell application "System Events"
click button "I Agree" of window "Adobe AIR Setup"
end tell
end tell
end try
You could try GUI scripting the commands with delays in-between clicks, but it's a little bit of work. Since the Adobe installer doesn't support clicking from applescript, you will need to download ExtraSuite and follow along with this previous MacScripter post.
To get pixel coordinates, start up the installer without AppleScript and type '⌘ + shift + 4' to get the crosshairs with pixel location (usually used for taking screenshots). Write down the coordinates for the first button and then hit 'esc' and move to the next button.
This is a pretty painful way to get the job done but there aren't many other alternatives that I know of.
It looks like the Adobe installers don't use Cocoa and aren't scriptable. You might have better luck with Sikuli. It's based on matching bitmaps and doesn't depend on any underlying framework.
How can I open the Dropbox preferences window using Applescript?
I'm assuming it would be something along the lines of
tell application "System Events"
tell application "Dropbox"
keystroke "," using command down
end tell
end tell
But this isn't working. Perhaps it's because Dropbox is running in the tray / background? ie: I can't switch to it using command-tab.
Thanks!
Unfortunately there is no way to do this. NSStatusItems (of which Dropbox is one) are not visible via accessibility. This weblog entry and this bug provide more information. Please file a bug and reference that bug number if this is important to you.