Launching applescript on terminal

Hi,
I would like to get all names in Address Book, So I tried this mixt of shelle script and AppleScript but it doesn't work :
osascript -e 'tell app "Address Book" to get the name of every person'
I'm getting an error, the Shell doesn't know "Address" ?
Can you help me ?
Many Thanks

Well, you haven't been keeping up with updates: your shell script works fine in 10.6.8, so maybe it's a 10.6.4 bug. try using 'application' instead of 'app' ('app' is a synonym which may be tripping up osascript).  And double-check that you have everything quoted and spaced correctly - that's what normally trips up applescript/unix hybrids.

Similar Messages

  • I am trying to load a calpatch to a program called Caldera, but i keep getting the following "AppleScript Error – Terminal got an error:apple event timed out ( -1712)" my IOS is Yosemite, and i am running the latest version of the caldera program

    I am trying to load a calpatch to a program called Caldera, but i keep getting the following “AppleScript Error – Terminal got an error:apple event timed out ( -1712)” my IOS is Yosemite, and i am running the latest version of the caldera program

    Hi Linc, thanks for this ... it is weird, we tried this previously, but we only did a restart.
    This morning our Mac was 'off' even though we hadn't turned it off, (maybe a power outage) I restarted and ran the calpatch immediately, and it worked !!
    it is embarrassing, because as a service engineer, I am always telling customers to restart and even power down completely before trying again.
    Thanks.
    Snakeydee

  • Launching programs with terminal

    hi, how do i launch programs via terminal? I type exec, press space, then drag a program to the terminal screen (to display it's location) , and then press return. It just tells me "permission denied" It does it on both my compters with with os X.

    Hi Jordan Perreault2
    Welcome to Discussions.
    Open is the command you want.
    In Terminal use the command, then space, application.
    open thepathtothe/application.app
    press return.
    If this solves your question, please consider awarding stars, by checking the helpful or solved button above on the post. This is not a requirement, merely an expression of thanks.
    regards roam

  • AppleScript or Terminal Control for "View Options"/"Always open in ... view

    Greetings, folks!
    I have not been able to figure out how to script (or, even better, a Terminal command line) control of the "Always open in (name of view) view" checkbox in the “View Options” panel for LARGE numbers of windows; I prefer not to use GUI scripting, it takes too long.
    I do not EVER want that box unchecked and do not want to have to manually check many thousands of folder’s checkboxes. As soon as I can figure this out, I will set every folder on my hard drives to always open in list view and write a script such that any folder created will automatically be set to always open in list view.
    AppleScript can set every attribute value in a window, except the "Always open in (name of view) view" checkbox.
    I have always expected that the data would be stored in the “.DS_Store” file, but, AFAICT it is not; changing the value for a “.DS_Store” file, logging out and back in, and then re-opening it in HexEdit or BBEdit showed the pre-change and post-change files to be identical.
    Thoughts?
    Thanks!!

    Additional info, in case anyone is running into this issue...
    If I do the following with the "root level" of the disk image, I can set the "Always Open in List View" option.
    1. Open the "root level" view of the disk image - for me, it always opens in icon view. Then, select "Show View Options" from the View menu.
    2. Check the "Always Open in Icon View" box. While leaving this dialog open, select "as List" from the View menu.
    3. Uncheck the "Always Open in Icon View" box. It will instantly turn into "Always Open In List View". Recheck this box immediately, then close dialog. This will make the setting stick.
    I've been able to repeat this situation several times. I might be wrong, but it sure acts like a small bug to me. Hope this helps anyone else who might have encountered this issue.

  • How to launch a new terminal window from the current Finder folder?

    Hello. I would like to have something like "DOS prompt here" menu item on the Finder popup menu, so that when I click it a new Terminal window is open and set to the respective directory.
    Any ideas?

    I don't know of a way to do that... You might be able to use FruitMenu
    http://www.unsanity.com/haxies/fruitmenu
    and create a script to launch for the contextual menu that does what you want.
    I just open Terminal (by clicking the icon on the Dock), type "cd " and drag the icon of the folder I want to go to to the terminal window (and Return). It's a few steps but not that bad.

  • Make applescript display terminal prompts

    Hi,
    I new to applescript, and am trying to to automate some terminal commands. At one point, the user is required to enter information to complete the command in the terminal. Is there a way that I can either show the terminal, or set some sort of display to display the prompts?
    Thanks!

    Would I be able to request that info and then place it into the terminal prompt?
    Sure.
    set username to text returned of (display dialog "Enter your username" default answer "Joe")
    set password to text returned of ("Enter your password" default answer "" with hidden answer)
    set theURL to "http://www.site.com/page.html"
    do shell script "curl -u "& username & ":" & password & space & theURL
    The idea here is to prompt the user for the data and combine the answer(s) with the static text that's passed to the shell.

  • Launcher/shortcut for terminal new-window entries?

    Is there any way to either create a keyboard shortcut, or icon shortcut for launching the entries in the terminal menu "shell|new window" ?
    I have several entries in there, and have ssh commands in there to connect to my work machines through a tunnel, such as:
    ssh -l jsmith dmz.foo.com -t /import/local/bin/ssh -l jsmith myhost
    I would like to be able to launch individual ones directly, either through the keyboard or icons.
    Thanks,
    -jamie

    Try iTerm
    <http://iterm.sourceforge.net/>
    You can assign *Command-Control-LetterOrNumber* to each of your iTerm bookmarks.
    For example, I have an ssh based iTerm bookmark that connects to my Linux development system at work. I want 6 new sessions, so I just hold Command-Control and press the letter 'L' 6 times and I get 6 new iTerm tabs each connected to my Linux development system.
    For Terminal, you should be able to configure a hotkey via System Preferences -> Keyboard & Mouse -> Keyboard Shortcuts.

  • How to run an applescript through terminal

    Hi Friends,
    I want to run an apple script by terminal. Any ideas how can we do it?
    I tried using the below code in terminal as
    osascript script_name.scpt.
    But, it returns an error.
    Thanks for your help!
    Regards,
    Abhishek

    Hi,
    I am sorry for not being explicit in my earlier post.I wanted to know basically what is the syntax of running an applescript through my terminal.
    Below is the errror message when I use the below syntax in terminal
    osascript script_name.scpt
    2012-10-30 11:34:43.667 osascript[2388:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find:
              /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
    osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.
    2012-10-30 11:34:43.669 osascript[2388:903] Error loading /Library/ScriptingAdditions/QXPScriptingAdditions.osax/Contents/MacOS/QXPScript ingAdditions:  dlopen(/Library/ScriptingAdditions/QXPScriptingAdditions.osax/Contents/MacOS/QX PScriptingAdditions, 262): no suitable image found.  Did find:
              /Library/ScriptingAdditions/QXPScriptingAdditions.osax/Contents/MacOS/QXPS criptingAdditions: mach-o, but wrong architecture
    osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/QXPScriptingAdditions.osax" declares no loadable handlers.
    script_name.scpt: execution error: No user interaction allowed. (-1713)
    Hope it helps!
    Thanks,
    Abhishek

  • Launching Safari from terminal window

    Hi,
    I would like to launch Safari from the terminal window to an HTTP url. When I do that Safari launches with file://http://.
    One of the suggestions I've heard is to use open -a, as I am launching other browsers/applications, I would like to keep one consistent way of launching the browser.
    Thanks
    loganwol.

    Pietro_D wrote:
    (The application is for the iPhone, I think NSWorkspace isn't part of the SDK...)
    You left that part out. I guess you're on your own as I haven't looked at the iPhone SDK at all. Sorry.

  • Error on launching Applescript app

    Hey, i created some Applescript app which i scheduled using  Schedule manager or Task Till Down and everything was ok.
    Since 1 month, after a while i turn on the laptop and that everything is running, i receive the alert message (in attachment). If i execute the apps from inside Applescript they are ok.
    After restarting all is working again for a while (sometimes minutes or hours) and then the same problem again.
    Do you have an ideal of which can be the problem?

    Hi,
    I'm sorry for give any solid suggestion about this problem, but I found another thread which similar with yours may be helpful, please take it as reference and try the solution of it.
    http://social.technet.microsoft.com/Forums/windows/en-US/c4147bcc-a430-43fe-b4e9-f999552568da/81-store-apps-wont-load?forum=w8itprogeneral
    Roger Lu
    TechNet Community Support

  • How do I launch AppleScript Utility

    Hello, I am working my way through the AppleScript 1-2-3 book by Soghoian and Cheeseman. Chapter 14 is on the topic AppleScript Utility and says in order to open the AppleScript Utility I can either find it in the AppleScript Folder in Applications or I can open it by choosing Open AppleScript Utility from the script menu while in AppleScript. Unfortunately AppleScript Utility is not located in the AppleScript Folder and there is no open AppleScript Utility in the AppleScript Script window. I am running SnowLeopard. I also tried running a search in finder. Does anybody know where I can locate AppleScript Utility? Thanks, George

    There is no longer an AppleScript Utility. "its pieces \[are\] scattered elsewhere"
    "AppleScript Folder In 10.5, this folder contained four distinct programs: AppleScript Utility, Example Scripts, Folder Actions Setup, and Script Editor. In 10.6, this folder is gone, its pieces scattered elsewhere. The biggie of the group, *Script Editor, can now be found in the Utilities folder, under the new name AppleScript Editor.*"
    "In 10.5, *AppleScript Utility* let you change the default script editor, enable GUI scripting, set up Folder Actions, and enable or disable the Script menu in the main menu bar. *In 10.6, you set the default script editor and control the Script menu from the General tab of the new AppleScript Editor’s Preferences panel. Folder Actions Setup is now an entry in the Finder’s contextual menu; Control-click on any folder and select Folder Actions to configure them.*"
    "The only scripting piece that seems to have vanished completely is GUI scripting control. *GUI scripting is tied in with Universal Access; you enable it by enabling access for assistive devices in the Universal Access System Preferences panel.*"
    From: http://www.macworld.com/article/142495/2009/08/snowleopardwhatsgonewhere.html
    Tony

  • [Solved]getting error when trying to launch kate in terminal

    i'm wondering why i'm getting this error message when trying to open a file with kate using root in standard terminal
    eg su
    kate /home/user/document
    and i'm getting this error mesage
    No protocol specified
    kate: cannot connect to X server :0.0
    when i try the same method with user account it work perfectl
    kate /home/user/document
    no error
    when i'm trying to open firestarter with root i get this kind message
    No protocol specified
    (firestarter:7848): Gtk-WARNING **: cannot open display: :0.0
    so i try with standard user and i this kind of message
    "insufficient privelige u need to be root"
    Last edited by burmmo (2008-07-01 21:03:42)

    You can always use
    xhost + localhost
    But the real solution lies here...

  • Mac pro goes to sleep and the error  log say "The smart launch will be terminated"

    Several times in the last few days my Mac Pro early 2008 has locked up.  This occures when leave the machine and come back to it.  I see the screen is black and the only thing that I see after clicking the mouse and pressing keys on the keyboard, is the white outline of the curser that will move across the screen.  Nothing will bring the system back and my only option is to hold down the power button until the unit shuts down. 
    I checked the logs in the console and the error message that I see is:  mm/dd/yy 9:49:17.719 AM SmartLaunch[31448]: The SmartLaunch will be terminated.
    Any clue where I should start looking?
    Steve Ornat

    That is a great idea to check the memory temperture.  Do they have built in temperture senors and then is there a terminal command to run to check that?  Also how do I change the speed of the fans, again a terminal command?
    I was mistaken, I bought 4- 4GB memory modules, with heatsinks. (8GB were tooooo expensive)  It should be good memory but certainly I wonder as this never happened before the new memory was added, 5 or 6 weeks ago.
    My memory config is:
    2 - 1 GB (orginal whe n I got the sytem)
    2 - 2 GB added 1 year ago from OWC
    4 - 4 GB added 6 weeks ago from ??
    Good suggetions about the hard drive.   I did add a new Seagate 3TB drive a year ago when I got this machine, and I use it for all my data stoage and tunes and pixs and only use the 250GB dirve of OS and apps.  I have not installed the OS and apps on the 3TB drive and that would be an easy thing to do.

  • Encrypt a folder through applescript or terminal

    Hey All,
    im wokring on an applescript and it makes a large number of folders in a specific hierarchy.
    is there a way to password protect one or more of those folders without the script opening the disk utility app to create the image?
    Thanks

    I assume you mean that you want to create a secure disk image (folders themselves cannot be encrypted, and you did mention disk utility).  If so there's a command line utility called hdiutil that will let you create and encrypt disk images; you can call it from do shell script.  If you read man hdiutil they give usage examples.  If you give more details we can show you the right code.

  • Applescript or Terminal Application Open Check

    I've run into a problem where my an applescript I was using hangs a machine running a newer version of the OS, then my 10.4.9 machine here at home, and was trying to figure out an alternate solution. Here's the details:
    I'm running the following script via command line:
    osascript -e '
    tell application "QuickTime Broadcaster"
    quit
    end tell
    On my usual machines, this highlight QT broadcaster (if its open already) and stops/quits a broadcast safely. If QT broadcaster is closed, it simply opens the app and then quits.
    On the newer OS version, if Broadcaster was closed ahead of time, it jumps up and down indefinitely on the dock and ends up crashing the app and requires the machine to be rebooted, which is rather unfortunate. So, I was wondering if there's a way around it.. 2 solutions I can think of:
    1. Is there a way in applescript to say "if the app is open, then (do all the stuff i have in quotes right now)"
    2. Otherwise, in unix, get a printout of all running processes that match Quicktime Broadcaster and then I could just pop in an if/then around the osascript
    Does anyone know how to do the 1 (applescript, if app open), or 2, (get a process match printout) fed into a variable that I can use in my unix script?
    MANY thanks

    applescript, if app open
    Sure - ask System Events:
    tell application "System Events"
     if (get name of every application process) contains "QuickTime Broadcaster" then
      tell application "QuickTime Broadcaster" to quit
     end if
    end tell
    Or in osascript form:
    osascript -e 'tell application "System Events"' -e 'if (get name of every application process) contains "QuickTime Broadcaster" then tell application "QuickTime Broadcaster" to quit' -e 'end tell'
    Shell:
    Use ps to get a name of running processes and grep for the one you want. Off hand I'm not sure of the actual process name for QuickTime Broadcaster, but I'm sure someone can come up with something. However, if you're using AppleScript to quit the app anyway, you might prefer to stay with an AppleScript solution - either that or use kill to kill the broadcaster.

Maybe you are looking for

  • Cannot resize using corners

    cannot resize using corners

  • Is this the product I should get?

    I'm a student who's starting video production next year, and I wanted a software like adobe after effects to add special effects to film. But after effects is expensive. I'm wondering if final cut express offers the same sort of technology? Also, con

  • How to spool DBMS_OUTPUT.PUT_LINE from SqlPlus?

    Hi, i have a stored procedure test: procedure test is begin dbms_output.put_line('Test'); dbms_output.put_line('Test2'); dbms_output.put_line('Test3'); dbms_output.put_line('Test4'); dbms_output.put_line('Test5'); end; I start the stored procedure ou

  • Adobe Illustrator CC 18.1.1 doesn't open files with "cmd O"

    Mac Pro (begin 2009), 2 x 2,26 GHz Quad-Core Intel Xeon, 12 GB 1066 MHz DDR3 ECC, NVIDIA GeForce GT 120 512 MB - OS X Yosemite 10.10.1 After having updated A.Illustrator CC to latest version I'm not able to open files by using "cmd O" and it's imposs

  • Yosemite and Canon LBP 5200

    I cannot seem to find a driver that fits between my updated Yosemite and my new (2nd hand) Canon LBP 5200. I downloaded the latest driver (for OSX 10.5) available from canon's website, http://search-au.canon.com.au/canon__au_en__au_en/search.x?q=&ie=