Tag Info

New answers tagged

0

This script in an Automator Dictation command seems to work. Not the fullscreen will not work properly if run in Automator or Script editor. It picks up the previous window 1. But any time I got the Dictation command to work. ( always find a bit of a pain to get them to understand me) It got the right window 100%. This script uses system profiler to get ...


0

I'll take my comment and make it into an answer; assuming I understand what you're looking for at least. Tested this code and it works fine for me. You'll need to adjust the numbers to indicate the relative position of your monitor. Assuming you don't move your screens around, it's a one-time entry. Credit to this answer on SO which also provides a link to ...


2

Update: I originally thought You don't need Applescript to do this. And you could create a Smart Group that does it for you. BUT the 'Company: is set' is not for the checkbox. Its for the actual Company text field. So you cannot use the above for this as it does not care if the checkbox for company is ticked or not. It only cares if there is ...


1

After few different attempts and hacks I found good solution to solve my problem. First - implement the script. Then open the Automator.app and create new application. Then combine Get Specified Finder Items action and Run AppleScript. So now open -a my_automator_app /path/to/file will pass /path/to/file/ to my script. And that's cool. P. S. in the argv ...


1

The answer has been posted on the Applescript user list: http://lists.apple.com/archives/applescript-users/2015/Jan/msg00193.html quote from page- code written by Shane Stanley You can do it easily enough with AppleScriptObjC. Here's are handlers to retrieve tags, set tags, and add tags: use scripting additions use framework "Foundation" on ...


0

From man open in EXAMPLES section: "open -a /Applications/TextEdit.app '/Volumes/Macintosh HD/foo.txt'" opens the document in the application specified (in this case, TextEdit). So You can specify path to Your AppleScript application after -a argument. I tested this and it works for me, path does not have to be absolute.


1

If you look in the StanardAdditions.sdef. Menubar menu : Windows-> Library Double click: StanardAdditions And change the dropdown to Javascript You will see that many of the script command change to the camelHump syntax app = Application.currentApplication() app.includeStandardAdditions = true; app.doShellScript('ls')


0

I can actually get your example to work with no problems, just doing something simple: tell application "Google Chrome" tell window 1 tell tab 1 get URL end tell end tell end tell That makes me think the problem might be in the "do something here" section of your script—I've never found Applescript's error messages to be very reliable. ...


0

So I've learned that: – Apple processes keystrokes in blocks – These keystrokes are application specific The following script was my attempt at this(I have shortened the "keystroke" to three lines for succinctness, if anyone wants to see the full, unedited code, let me know): tell application "TextEdit" activate make new document delay 0.1 repeat 2 ...


0

Using a test KeyDownEvent app. The keystrokes are registered from an applescript keystroke event. But I do not think you will be able to use this as a mask. The Applescript keystrokes will always insert the characters in the active app. Therefore typing in the area you are manually trying to type. So if you had a block of text like : ...


1

Well, it might kind of work, but idk if it would do what you want to achieve. This script tell application "TextEdit" activate make new document delay 1 repeat 100 times tell application "System Events" keystroke "the quick brown fox jumps over the lazy dog" keystroke return end tell end repeat ...


0

In the help text of the utility is says... UNRAR 5.10 beta 4 freeware Copyright (c) 1993-2014 Alexander Roshal Usage: unrar <command> -<switch 1> -<switch N> <archive> <files...> <@listfiles...> <path_to_extract> so you can include the path_to_extract at the end of the command and once ...


0

on run set cat to value of variable "cat" of front workflow (*I have already defined the variable elsewhere in the workflow*) set num to {} set myString to "" tell application "Contacts" repeat with i in cat set inGroup to group i set phoneProps to value of phones of inGroup's people repeat with i ...


0

Use a Run AppleScript action with the following to get the path: POSIX path of (path to me) When run in the workflow, this provides the path to Automator.app, but when run by launching the saved application, this provides the path to the application.


0

It's easy,you can do it in five steps! open applescript editor click Record open Finder and activate Google Chrome click Stop or the circle with a hexagon in front of it press Cmd+S and a window will appear - save your script as an application and click the circle with the words "start-up" next to it Epilogue: restart your Mac and watch Chrome appear ...


0

I would suggest simply saving aliases of each mounted network share. Assuming that you have allowed Keychain to store your credentials for these shares, they will mount automatically when you open the alias in the future. I personally use the following strategy. I add my ~/Library/Favorites folder to my Finder sidebar and my Dock. Then, I place aliases ...


0

It is not a "Finder" window. It is owned by Safari You have not made clear how you know which file to choose. So I assume you will be partially hard coding it into the script. This example assumes you are able to form a path string to the file. This example is also written to click and add an image to an Answer on one of these Ask-different pages. You ...


0

A few years ago I have used this software, but now I no longer use it. You need to test yourself whether it supports the latest OS X. You can find it there supports a number of evidence sources: Current Audio Output destination (speakers or headphones) Connected Power Adapter (based on serial number of the adapter) Bonjour CoreLocation, OS X’s location ...


1

Changing tell application "Finder" to mount volume "afp://Data_Cube.local/Scotts Stuff" to mount volume "afp://Data_Cube.local/Scotts Stuff" seems to be the resolution. As mount is part of the standard scripting library.


0

Sleep/wake cannot trigger scripts. EventScripts, although it is a very impressive program. it not fit this purpose it does NOT actually appear to be able to trigger scripts quickly enough before your Mac goes to sleep. but there are many third party solutions. For example, sleepwatcher


0

It looks like the AppleScript is run within Quicksilver’s process (depending on how you run it). If that’s the case, you’d need to relaunch Quicksilver. If it’s not completely frozen, you can do this quickly with ⌃⌘Q. It might also be possible to set some kind of timeout in the script to prevent it from hanging indefinitely.


0

I found my own answer by digging a little deeper into this. tell application "Safari" do JavaScript "document.getElementsByName('files[]')[0].click();" in document 1 end tell Using getElementsByName and the name attribute 'files[]' was all it took (and by the way was the ONLY way out many, many that worked in this case).


0

I was able to find the following: $defaults -currentHost write com.apple.screensaver idleTime n Where n is number of seconds before screensaver starts (0 = never) This is exactly what I was looking for. reference: http://hints.macworld.com/article.php?story=20080207030932483


1

Just to help out a bit more: In your main user directory /home// create a directory named 'bin' and put SwitchAudioSource in there. Here's some AppleScript which switches back and forth between two sources, the default 'headphone' mini jack output on the back of my Mac Mini (a laptop should be different), and my Sennheiser USB headsest. Call me 'Captain ...


2

Use {"com.apple.icns"} as the file type. set Icon to (POSIX path of (choose file of type {"com.apple.icns"} with prompt "Select a .icns file.")) (Found by running "mdls myiconfile.icns") kMDItemContentType = "com.apple.icns"


0

I would do this in Automator as a Service. Using a Open Images in Preview Action and a Run Applescript Action. So I could select the wo files and run the service on them. The Applescript code should get the Size of the screen and set the bound of the windows accordingly. set bnds to "" tell application "Finder" to set bnds to (get bounds of window of ...


0

I've slightly modified this to do exclusions as a set. set exceptionsList to {"MobileBackups", "startup disk", "home", "net"} tell application "Finder" set diskList to the disks repeat with mountedDisk in diskList if name of mountedDisk is not in exceptionsList then eject mountedDisk end if end repeat end tell


0

If you want an AppleScript, I adapted the script posted at: Shortcut to eject all external hard drives but not MobileBackups to this, and it works great. I've placed the applet for this in my dock to use right before I unplug. set exceptionsList to {"MobileBackups", "startup disk", "home", "net"} tell application "Finder" set diskList to the disks ...


0

Restarting preview also solved the problem of not being able to open files even from the finder due to this permissions problem, as Andy Dent suggested.


1

Open the two files with Preview, then run the following to position the windows: tell application "Preview" activate set the bounds of the first window to {0, 0, 700, 1000} set the bounds of the second window to {700, 0, 1400, 1000} end tell Customise the coordinates as you wish depending on monitor resolution. Syntax: {x1, y2, x1, y2} Enable ...


0

The Wacom driver allows you to set things up for individual applications. Have a specific setup for Photoshop (which excludes the display toggle setting) and then another one for all other apps.


0

There is apple script in this page How to switch tablet input between multiple monitors on a Mac. I tried it but I do not get it to work on my setup. I guess it's outdated, maybe somebody can update it.


0

this is how I solved it: tell application "iTunes" repeat with theTrack in selection set theFile to location of theTrack tell application "Finder" to set theName to name of theFile set ayahInSurahCount to 0 --set ayah information from the name of the track set surahNumAsString to characters 1 thru 3 of ...


2

This problem is caused by Apple's sandboxing of applications (in this case, OmniGraffle. Preview does not receive an entitlement to access the PDF if you just pass it a string to open. From Apple's release notes: Compatibility Notes When sending commands to a sandboxed application, such as TextEdit in OS X Mountain Lion, parameters that refer to ...


0

This would be my take on this: set ipList to {"8.8.8.8", "8.8.8.6", "8.8.4.4"} set Output1 to "" set Output2 to "" global Output1, Output2 repeat with i from 1 to number of items in ipList set this_item to item i of ipList my ipCheck(this_item, i) end repeat if Output1 is not "" or Output2 is not "" then display dialog (Output1 & Output2) ...


0

You need to be asking for the 'item' [record] referred to by the list 'label' [record property] The label [record property] is DNS1, the item [record] is the string "8.8.8.8" set ipList to {DNS1:"8.8.8.8", DNS2:"8.8.4.4"} set input to DNS1 of ipList set output to input display dialog output You can easily just shorthand that to set ipList to ...


0

if you are trying to set the volume in AppleScript a correct syntax would be as the following, no need to force button presses : tell application "System Events" set volume 4 end tell Now as you can see its a forced process. If you want more flexibility like determining where the users volume is currently at or set it to increment increase/decrease by 1, ...


1

I tried to use specifically Applescript/Automator to avoid 3rd party applications, but eventually I utilised capabilities of application called Alfred (I can not recall right now, but there is a chance you should buy Alfred Power Pack to use this feature) In addition with the help of Karabiner.app I forced CapsLock button to act as Shift+Cmd+Ctrl+Opt and ...


0

OK, I got it solved. I first mounted the disk with the image files from it's new, permanent location on the server. Then I opened iPhoto and slowly, image by image opened them. The bulk of them opened with no problem from the new location. A fair number, 100 or so out of 10,000, had lost their connection to the actual file. Most of these I was able to ...



Top 50 recent answers are included