Tag Info

Hot answers tagged

4

Although the page you supplied is returning an image of the answers which means you cannot return text from it. The source of the page holds the answer in text form in a javascript function. This applescript is using one of my old methods to get the text between pattens. I would probably now do this using ApplescriptOBJC but thought it better to keep it ...


3

Update Smart Playlist entry only resides in contextual menu; applescript cannot access that. There are two work-arounds I can think of: 1. BTT: hover over the playlist and invoke a combo right-click -> u -> return. Or: tell application "System Events" to tell application process "iTunes" set frontmost to true repeat 2 times tell menu item ...


3

Well, I have no clue what you want, but your code isn't guaranteed to work, which may be your problem. Try this: set image to POSIX path of (choose file of type {"sparsebundle", "sparseimage", "dmg", "cdr", "iso"}) do shell script "hdiutil mount " & quoted form of image Source: Part-time work as a prophet


3

Here's a subroutine for replacing characters: on replace_chars(this_text, search_string, replacement_string) set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text ...


3

I would recommend using the "grep" and "awk" commands from bash. You can use them to parse the data given in bash. Here is example using the details you described above. /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep "channel" | awk '{print $2}' Do yourself a favor and sym link the binary to ...


3

Here is an example In AppleScript using tron_jones's answer. The result of the command is set to _channel and then used in a dialog box just to show the result. Obviously _channel can be used in a variety of ways. set _channel to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep 'channel:' ...


2

TERM_PROGRAM is set by both Terminal and iTerm: TERM_PROGRAM=iTerm.app TERM_PROGRAM=Apple_Terminal


2

In my opinion, the best way to do it is by using Apple's own task scheduler: launchd, because you don't need to install third-party software. First, the theory: to run a script from the command line, you just run: osascript /PATH/TO/YOUR/script.scpt Knowing this, all you have to do is create a plist file in ~/Library/LaunchAgents/ with this: <?xml ...


2

I thought I might like to have something like this too, so I threw together an app that does this. Feel free to try it out! Warning though: I have one video where the skip value doesn't work. I'm not sure why it only has an issue with this one video... Just a heads up. It works 99% of the time though! Push 1 to place the video or image being shown in sort ...


2

As @kopischke said, install or upgrade reattach-to-user-namespace may solve this problem. If your reattach-to-user-namespace is old, notification works well after brew upgrade reattach-to-user-namespace.


2

Try adding this to your code: set first responder to text field 2 of window 1 This should bring focus to the text field. For reference, see this post on MacScripter


2

use this: display alert output volume of (get volume settings)


2

To create a second line use \n or just hit enter when you want the new line: display dialog "Test\nTest2" or display dialog "Test Test2" About the center alignment, I think that is not possible.


2

You can use CocoaAppleScript to do this. Create one by going into Script Editor's "New from Template" menu in the File menu, and "Cocoa-AppleScript Applet.app". Modify html_data's HTML code to get it to be how you want it. Try it out!: set alert to current application's NSAlert's new set alert's messageText to "" set text_field to current application's ...


2

When you check the notification center you will see that the messages still appear there but the center won't notify the user when the app sending the message is in the foreground. Workaround: Before firing the notification, activate Finder: tell application "Finder" to activate set lasttime to current date set min to 5 as number set interval to 1 as ...


1

Use the section's name to click on the "Copyable plaintext" button : first section = pod_0100, second section = pod_0200, third section = pod_0300 Use the button's index : ('action subpod-copyablept ')[0] = the first "Copyable plaintext" button in a section. ('action subpod-copyablept ')[1] = the second "Copyable plaintext" button in a section. ...


1

tell application "Finder" to set disklist to every disk whose ejectable is true or local volume is false and name is not "home" and name is not "net" set namelist to {} repeat with diskitem in disklist set end of namelist to name of diskitem end repeat return namelist


1

This will check for all instances of VLC and pause any of the instances that are currently playing something. Let me know if something unexpected happens! To create the shortcut, follow these steps: Open Automator and create an Service, with a single Run AppleScript action, containing the following code: tell application "System Events" to repeat with ...


1

tell application "System Events" to tell process "SecurityAgent" to ¬ set frontmost to true


1

Step one: When saving the script in the script editor, save as an application bundle, then add it to the startup items in login system preferences. Step two "Background" Use a app iBackground Scripts for Mac Simply drag and drop an AppleScript that has been saved as an 'Application bundle' on to this droplet. Clicking on the 'Yes' button will set ...


1

If you only have a few lines of output, you'd want to assign it to a variable and then display a confirmation dialog showing the output. add Action "Set Value of Variable" enter a new variable, e.g. output add Action "Ask for Confirmation" in the message field, enter the variable name declared above. While typing the variable name, Automator will suggest ...


1

You sure can! Try this: say "the company [[slnc 1200]]" using "Alex" saving to ((path to home folder as string) & "TheCompany.aiff") Note that you have to use the AIFF format, which iPods do support. This will save it in your home directory. You have to install FFMPEG for the final part of this script. You may have to install the developer tools ...


1

If you lock an app to a space it will always open in that space, no script required. the limitation is that all windows of each app will be in the same space; no way round that except manually, afaik. First open the app in the required Space, then right click the Dock icon & select 'This Desktop' After that, if you check from any other Space you will ...


1

You can use the following in an AppleScript to shutdown the system: tell application "System Events" to shut down If you really want to click the menu items you can go straight to clicking the "Shut Down" button with the following: tell application "System Events" to click menu item "Shut Down" of menu 1 ¬ of menu bar item "Apple" of menu bar 1 of ...


1

I found a work-around in a German forum post. Add these lines to the top of your script: use framework "Foundation" use scripting additions current application's NSThread's sleepForTimeInterval:1


1

You can't change the container, because this property is read only --> container (list, r/o) : r/o means read only But you can use the move command tell application "Reminders" set output to "" set newList to list "Ausgaben" show newList repeat with thisReminder in (get reminders in list "Erinnerungen" whose completed is false) set ...



Only top voted, non community-wiki answers of a minimum length are eligible