Command line options for Safari

I have a script that opens a Safari window by doing essentially the following:
open -a safari http://www.apple.com
According to the man page for open, I can add more args to this that would get picked up by Safari, as follows. Of course the man page for open can't indicate what such args might be or even if Safari pays any attention to them:
open -a safari http://www.apple.com --args arg1 arg2 ...
Are there any such args one can usefully pass to Safari in this way? Specifically, I'd like the command to be able to control the size of the window that is opened, perhaps as follows:
open -a safari http://www.apple.com --args h=300 w=400
Thanks.

While I'm no Terminal expert, I believe you might be interested in using osascript. You can check its man page by entering *man osascript* at the Terminal prompt. Also, a Google search for osascript should yield some good returns.
In short, entering *osascript -e* at the Terminal prompt, followed by a valid AppleScript command executes the script action. More than one argument can be used at a time by adding another -e, followed by a new AppleScript command.
The example below causes Safari to open apple.com, with the window resized to your specifications. Copy the entire piece of code, paste it at the Terminal prompt, and press Return:
*osascript -e 'tell application "Safari" to open location "http://www.apple.com"' -e 'tell application "Safari" to set bounds of front window to {10, 60, 400, 300}'*
Good luck, hope this helps.

Similar Messages

  • Is there a command line option for VNC to automatically launch in fullscreen mode?

    I can launch a VNC window from the command line, as such:
    open vnc://username:password@hostname
    ... but I'd like it to automatically start in full screen mode. Is there a command line option for this?
    I'm using an old MacMini purely to connect to another Mac over screen sharing, but when the MacMini boots I'd like it to go straight into the fullscreen of the other desktop.
    Many thanks!

    Set the Integer pref browser.sessionstore.max_resumed_crashes to 0 on the about:config page to get the about:sessionrestore page immediately with the first restart after a crash has occurred or the Task Manager was used to close Firefox.
    * http://kb.mozillazine.org/browser.sessionstore.max_resumed_crashes
    That will allow you to deselect the tab(s) that you do not want to reopen, but will allow to reopen other tabs.
    See:
    * http://kb.mozillazine.org/Session_Restore#Restoring_a_session_after_a_crash
    * http://kb.mozillazine.org/Browser.sessionstore.max_resumed_crashes

  • Q. Any command-line options for Digimarc and Elements 7 batch file processing?

    Q. Any command-line options for Digimarc and Elements 7 batch file processing?

    Are you a digimarc subscriber? You would be better off asking them, if so.

  • File name as command line option for multiple VM processes

    "-Xloggc:/tmp/gc.log" is the option I'd like to set, but every process will log to that file and even if we don't experience any concurrency issues the data still isn't useful because I can't tell which process did what.
    The island files are cleverly named to include their process number, can I do similar for command line options or will I be restricted to a single JVM?

    Online help (as of LabVIEW 7.0?), Index, Command Line, User-defined arguments - It will show you the following:
    You also can pass LabVIEW-defined or user-defined arguments when you launch LabVIEW from the command line. To pass user-defined arguments in the command line, enter two hyphens (--) surrounded by spaces before the set of user-defined arguments. LabVIEW does not use any arguments after the two hyphens to launch labview.exe. LabVIEW passes the arguments after the two hyphens to the block diagram of the VI you launch. Use the Application:Command Line Arguments property to read the user-defined command-line arguments passed when LabVIEW launches.
    For example, to launch mycool.vi and pass user-defined arguments, use the following command:
    c:\labview\la
    bview.exe c:\coolapp\mycool.vi -- 1000 sine
    On the block diagram of the mycool.vi, use the Application:Command Line Arguments property to read the 1000 and sine arguments you passed and handle the values.
    Enjoy,
    Roy

  • 'autorotate and center' command line option for acroread toPostscript

    Hello,
    Is there a command line option available for 'autorotate and center' (like in the graphical view of acroread) while you convert a pdf to postscript on command line?
    I must convert an A4 pdf to 'portrait' letter (fanfold). With the command below, everything is fine only the pdf is not rotated.
    My command looks like:
    acroread -toPostScript -size 792x612 -shrink -expand < pdffile.pdf
    Mvg,
    wim

    Hello,
    Our application generates A4 pdfs (reports) in portrait format. Now we have some matrix printers (Epson LQ680Pro) which are feeded with fanfold letter paper (11x8.5in - 792x612pix). The fanfold paper hangs on each other with the larges side (11in) - 90° rotated as by 'normal' paper.
    What we have to do, is rotate (90°) and scale (A4 to letter) our pdf before we can print it correclty.
    I've now fixed it with following commands (because acroread can't rotate, we use pdf90 to rotate our pdf first):
    pdf90 --outfile tmp.pdf report.pdf;
    acroread -toPostScript -size 792x612 -shrink -expand < tmp.pdf | lpr -P Epson_LQ680Pro -o Resolution=180dpi -o PageSize=FanLetter;
    note: the Fanletter papersize is a self-defined papersize in the pdd for the printer.
    Sincerely,
    Wim

  • Command line options / API Support to launch the sequence file

    does teststand support any command line options / API Support to launch the sequence file and also populate the test run status. I want to explore the option of integrating the teststand with QC where I can launch the sequence from QC and results are sent back to QC.
    Thanks in advance,
      -Dilip

    Hi Dilip,
    Here are the command line options for TestStand v4.2.1:
    Command Line Processing
    Command line usage:
       seqedit.exe [<sequence file>]
                   [/goto <location>]
                   [/run <sequence> <sequence file>]
                   [/runEntryPoint <entry point> <sequence file>]
                   [/quit]
                   [/setCurrentDir]
                   [/useExisting]              
                   [<workspace file>]
          <location>:  property object path to the item to display in the file
                   Location examples:
                         TestExec.exe c:\example.seq /goto "Seq[\"MainSequence\"].Main[\"Power On\"]"
                         TestExec.exe c:\example.seq /goto "Seq[\"MainSequence\"].Main[\"ID#:JifH4ODTf0y1z7bJ​ne0G7D\"]"
                         TestExec.exe c:\example.seq /goto "Seq[1].Main[4].TS.LoadOpt"
          <sequence file>:  sequence file to open
          <sequence>:       sequence to run
          <entry point>:    entry point, such as Single Pass or Test UUTs, to run
          <workspace file>: workspace file to open
       You may specify multiple sequence files, sequences, and entry points.
       Quotes are required for arguments that contain a space, such as
       "Test UUTs" and "C:\My Documents\Test Sequence.seq"
    I don't believe you'll get a return status of the executed sequence from the editor on close; but you could design your sequence to write the status to a file and then read that by your QC application.
    -Jack

  • Why can I not find "command line options" in FF help?

    I can't find any information in the knowledge base on windows command line options for Firefox. I actually had to go to "http://kb.mozillazine.org/Command_line_arguments" to find this information. This seems like a fairly common piece of information FF users would want to know. At least, it's not extraordinarily rare.

    You have out-of-date plugins with known security issues. You should update them.
    * Adobe Shockwave for Director Netscape plug-in, version 10.3
    * Next Generation Java Plug-in 1.6.0_21 for Mozilla browsers (new security update releases 10-12-2010)
    #'''Check your plugin versions''': http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update Shockwave for Director'''
    #*NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    #*Use Firefox to download and SAVE the installer to your hard drive from the link in the article below (Desktop is a good place so you can find it).
    #*When the download is complete, exit Firefox (File > Exit)
    #*locate and double-click in the installer you just downloaded, let the install complete.
    #*Restart Firefox and check your plugins again.
    #*'''<u>Download link and more information</u>''': http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox
    #'''Update Java:'''
    #* Download and update instructions: https://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox
    #* Removing old versions: http://www.java.com/en/download/faq/remove_olderversions.xml
    #* After the installation, start Firefox and check your version again.

  • Starting Safari with command-line options

    I am an old Unix Hacker who just started with Mac. Since scripting is an important
    part of old-school UNIX, I do many things via scripting.
    My question is: Is there a way to start Safari from the command line using command-line
    options that will allow Safari to open up multiple tabs with each tab pointing to a pre-defined
    URL?
    Thanks,
    msprewitt

    Hi,
    Type this in terminal,
    open http://www.google.com http://www.yahoo.com
    It will open the two web pages in two tabs. man open for more option.

  • File format for username/password file for -vcusersfile command line option

    In what format do I specify username and password in a file that I can use for
    the -vcusersfile command line option?

    The text file should contain name/password pairs separated by an equal sign. Example:
    myname1=password1
    myname2=password2
    Hope that helps,
    Susan Doan

  • Command line option to specify Bridge master cache

    Please allow a bridge command line option to allow the user to select a specific bridge master cache.
    The  motivation is as follows:  I have written a c++ programme to key-word  all of my many thousands of photo projects.  Essentially each project is  in a separate directory on 8 terabytes of networked disk.  Associated  with each directory is a set of key words.  When the appropriate project  is selected, I invoke Bridge to open that directory, possibly with a  specific images as the "starting image" for that project.  Since the  master cache files are split (to accomodate the 500,000 max image count  supported by bridge), it would be excellent if I can pass a reference to  the specific master cache associated with that directory.
    A second value of this option would allow the user to create desk-top short-cuts to invoke bridge using an appropriate cache structure.  For example, the properties of one short cut could specify the cache file for the current daily use of the Bridge to process images in progress.  A second could point the the cache associated with the historical first 400,000 image archived on the network, and a third could invoke bridge pointing to the cache for the next 400,000 image cache - or whatever grouping the user needs to match his workflow when using Bridge as the central focus for various digital assets..
    This type of processing allows the user to conveniently invoke bridge according the the needed work flow when multiple cache systems are required.  In addition, the multiple desk-top shortcuts would minimize the "error" of having bridge pointed, by accident/neglect, to the incorrect cache structure.
    It would also be valuable to allow the user to display the current number of actual image items in a cache system - either as a "view" or "tools" option.  This would allow the user to know when it is time to start a new master cache system. Of course, this can be intependently viewed in windows explorer by the count of files in the 1024 or 256 directories - however maybe the cache structure already "knows" this number instantly.  Other statistics could be interesting as well - possibly the number of directories known to the cache (possibly the same as the count of directories within the 1024 or 256 directories). Possibly the number of files cached by file type (jpg, tif, psd, cr2, nef, etc) would be of interest to some folks - however, such things should be user-selectable since such analysis might be time intensive and maybe of no interest.
    Of course, I do not know if this is consistent with other uses of Bridge - this request is made based upon my use of Bridge as a still photographer and a few videos I have created.
    thank you....
    tony

    I'm going to be technical for a minute, just for the Forum archives...
    The Library file location is stored in your "iTunes Prefs.xml" file in<pre>%APPDATA%Apple ComputeriTunes</pre>.
    Actually, I should say that if you are using a non-default location, there is a key for "iTunes Library Location:1", e.g.:
    <key>iTunes Library Location:1</key>
    <data>
    QwA6AFwARABvAGMAdQBtAGUAbgB0AHMAIABhAG4AZAAgAFMAZQB0AHQAaQBu
    AGcAcwBcAFQAZQByAGkAZABvAG4AXABNAHkAIABEAG8AYwB1AG0AZQBuAHQA
    cwBcAE0AeQAgAE0AdQBzAGkAYwBcAHQAZQBzAHQAbABpAGIAcgBhAHIAeQA=
    </data>
    The "data" is a base64-encoded UTF16-LE string that is the folder containing the "iTunes Library.itl" file and "Album Artwork" folder. In the above case:<pre>C:Documents and SettingsTeridonMy DocumentsMy Music     estlibrary</pre>
    The key/data pair does not exist if you're using the default Library location.
    Similary, there is a key/value pair for "iTunes Library XML Location:1" -- except this part always appears, even if you are using the default location. Also, it is the full path to the file itself, not just the directory containing it. e.g.:<pre>C:Documents and SettingsTeridonMy DocumentsMy Music     estlibraryiTunes Library.xml</pre>
    Since it doesn't appear that double-clicking on the Library file you want to open works, I'm guessing the only way to swap locations is to edit the preferences file -- either directly, or with a script/program. I could probably write such a program in a 1/2 hour or so... I might just do that right now.

  • Is there a command line method for publishing/deploying reports?

    Is it possible to publish/deploy reports using the command line? 
    Also, it is possible to change the datasource for a report via some command line option?
    I am developing the reports locally (Win XP), and then checking them into source control.  They need to be deployed to a BO Server for Dev, Test and Prod.
    I would like to be able to create a script to deploy the reports into the different environments.
    In addition, the datasource needs to be changed before deploying to TEST (since it is on the same server as DEV, just a different port).  Having to manually open each report and change the datasource as the reports are migrated could get to be time consuming as the number of reports increases.
    Thanks for any suggestions.
    Paul

    Hi Paul,
    No, but you can do all of this using one of our SDK's. Look for samples above or from this WIKI:
    Root Page
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsHome
    Enterprise Samples (including managed and unmanaged ras)
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsSDKSampleApplications
    Non-Enterprise Samples
    http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsSDKSampleApplications
    Exporting Samples (RAS)
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples#NETRASSDKSamples-Exporting%2FPrinting
    Thank you
    Don

  • Command line parameters for al_engine.exe

    If you go to a command line window on a DS server and type al_engine.exe with no parameters it prints "Usage" information.  Some of the parameters it mentions are known to the community (like -XX, -XI, etc).  However there are some which sound pretty interesting, but I can't find any information or examples how it should be used.  Examples:
    -L<list of value> : List of Object Labels from UI (separated by , or ; or space) to filter.
    -Je<XML file> Execute the Installation scenario defined in XML file.
    -jd"datastore delta file in quotes>" : Modify datastore values using "file"
    -Jf, -Ja, -We,  and many more.
    I am particularily interested in -Je functiohnality - it sounds like it can be used to automate deployment.  I am using import/export options to do some automation, but real automation would include deletion of some objects, adding jobs to projects, etc.
    Can anybody help with the documentation/examples?

    The preferred way is to save your workflow as an application and then call usr/bin/open on it. If for some reason you must have the workflow run inside of Automator (not self-contained) then you're looking at some quality time with man osascript. As it happens Apple has removed even the need for Cron for most users. A click to File -> Save As Plug-In -> for iCal handles it from start to finish.
    Edit: I forgot to mention that Automator has its own simple command line utility for running *.workflow files. Check out man automator

  • Split PDF by pages using command line options

    Hi,
    I am after a product to split a PDF file by pages / bookmark using command line options.  It would be good, if the product comes with functionality to call from VB/.NET SDK.
    I googled and came across many products, out of these following looks good.  Has anyone used this.  Please suggest me.
    www.neeviapdf.com
    www.coherentpdf.com
    Thanks
    Sarav

    You are posting in the wrong forum. This forum is for Acrobat Scripting.

  • JDev specifying SQLJ translator command line options

    Hi,
    I have come across the problem of SQLJ connections caching up to 5 sql commands and so leaving any related cursors open. This is happening mainly for statments where I have executed a SELECT ... INTO ... Any sqlj with iterators, I have closed the iterators so they do get removed and their cursors closed.
    I have found that caching can be switched off via the SQLJ translator command line option -P-Cstmtcache=0.
    How can I specify this command line option within my JDeveloper project settings? I don't want to have to build my project from the command line explicitly as this will complicate the Release Software Build procedure.
    Can anyone help me, please?
    Thanks a lot.

    Can anyone offer any words of wisdom on this? We are currently using JDeveloper 3.1 (Build 681)

  • Javadoc command line options

    I have a custom doclet which generates xml output instead of the default ouput from javadoc.
    I am trying to pass custom command line options to my custom doclet class.
    The following is my javadoc command:
    javadoc -classpath c:\junit\junit3.8.1\junit.jar;C:\j2sdk1.4.1\lib\tools.jar -doclet DocGenerator -dest c:\docgen\temp C:\DocGeneratorTest.java
    When i use the above command i get the following error:
    javadoc: invalid flag: -dest
    I am trying to access the value of dest in my custom doclet.
    Regards
    -rv

    Perhaps the following will help. It explains how to use command-line options
    Any doclet that uses custom options must have a method called
    optionLength(String option) that returns an int. For each custom
    option that you want your doclet to recognize, optionLength must
    return the number of separate pieces or tokens in the option. This page gives an example:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/overview.html#options
    -Doug Kramer
    Javadoc team

Maybe you are looking for