Hot answers tagged

3

There is an easy way to do that right in Gmail. In the settings tab, go to settings and first add a forwarding address under Forwarding and POP/IMAP. Enter the desired forwarding address and confirm it by entering the confirmation code or clicking on the confirmation link. Then go to the Filters and Blocked Addresses tab in settings. On the bottom of the ...


2

Using the included Script Editor.app with OS X, try experimenting with these snippets. Wait 30 Seconds The following snippet will make your script wait 30 seconds before showing a dialog: delay 30 -- this waits thirty seconds display dialog "Hello?" -- this shows a dialog Sleep The following snippet will put your Mac immediately to sleep: tell ...


2

Paste this script into script editor and save it as a service. Map the service to a keyboard shortcut. tell application "Safari" activate tell current tab of window 1 do JavaScript "location.reload();" end tell end tell EDIT tell application "Safari" activate tell window 1 --options set myTab to tab 1 ...


2

AppleScript is written in English. Read what it says! Remove the posix path of from the code, and you'll get the HFS path. Full code: tell application "Finder" to get (container of (path to me)) as text


2

No - Applescript is not multi-threaded in the sense that you can set up two things to happen at one time. To do what you want, you'd need another language that could open a window so the user could type characters to be interpreted and change the signal variable to exit the loop. That language would handle multiple threads and communication between the two ...


2

First, you're trying to check against text returned of y, where y is text returned of x – a string, not a dialog result so text returned of y won't work. Just use y. Second, you need to be testing your string stored in y against another string, not a number. Wrap 3232 in quotes: set x to display dialog "What is your password?" default answer "" with hidden ...


2

Here is an Automator Service that becomes available in Finder when Folders are selected and emulates the context-menus Compress [n] Items command except it creates an individual zip archive file for each selected Folder in the name of the selected Folder. If the Folder Name.zip file already exists then a " 2" (space 2) is appended to the filename, e.g. ...


2

Certainly the easiest way to accomplish this is by using do shell script. pmset is definitely a viable option, though I am personally partial to the caffeinate command, which doesn't modify any preferences and doesn't require administrator privileges. You could use the following AppleScript to keep your screen awake indefinitely: do shell script "caffeinate ...


2

Use this instead (source and short explanation): if the text returned of the result is "Cameron67" then set the_results to (display dialog "Welcome! What would you like to do?" buttons {"Chrome", "Messages", "More"}) set button_returned to button returned of the_results if button_returned is "Chrome" then tell application "Google Chrome" ...


1

As one of the commenters alluded to, "get first message of inbox" probably won't return what you expect. When retrieving messages using AppleScript, Mail sorts your mailbox accounts alphabetically. Within each account's inbox, messages are sorted newest first. What you have selected in Mail doesn't change the order in which they're returned to ...


1

To make this work you have to use a third party tool: Karabiner. I propose to use one of the option keys though: usually one of both is rarely used and you can use M as normal key. Download, install and open Karabiner Open in the menulet Karabiner -> Preferences Enter "Space" Enable the chosen keycode and close the window.


1

You can work around this with something like set a to "/tmp/" & fileName set targetFile to POSIX path of a --since you are using curl do shell script "curl http://example.com/images.jpg > " & targetFile This AppleScript will make a string containing /tmp/, and targetFile sets it to interpret as POSIX (used by shell and curl). Then it downloads ...


1

You can execute shell script directly on OS X, so there's generally no good reason to do that. However, if you really feel like it, you can use do shell script "script" to execute a shell script in AppleScript.


1

General when using the do shell script command, you will need to use the quoted form property of text objects. In other words, do something like this. set command to "ls" set result to do shell script quoted form of command display dialog result


1

Add this to Your Info.plist file: <key>CFBundleIconFile</key> <string>filename</string> where filename is Your .icns file inside Contents/Resources directory. Info form the Apple Documentation CFBundleIconFile (String - iOS, OS X) identifies the file containing the icon for the bundle. The filename you specify does not need to ...


1

I'm not going to pretty this up like Graham Miln nicely did however it you want to create an AppleScript app that you can run before disconnecting your external display then this will wait 30 seconds, check to see if it's in clamshell mode and if yes put the system to sleep. AppleScript code: delay 30 set AppleClamshellState to do shell script "ioreg -r -k ...


1

You could also do this with Mail rules. The gmail method is better in that the forwarding happens when Mail isn't running, but you can set up a rule as follows: The rules section is just in Mail preferences. You might try redirect instead of forward and see which "mom" prefers. I also added a bonus action of marking the message read - you can explore ...


1

The curl command in the do shell script command is malformed. The -o option expects a filename or a fully qualified pathname filename not just a path like what the variable theFilePath contains. See the man page for curl, in a Terminal type man curl and press enter and then scroll down to -o, --output <file> where it states: Write output to ...



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