IDCS6(MAC) 10.9.4 - a script that will make an anchored object and paste in clipboard contents

I'm trying to create a script that will create an anchored object that will paste in clipboard contents.
So far I have:
var frameRef = app.selection[0];
    var parentObj = frameRef.insertionPoints.item(0);
    var anchorFrame = parentObj.rectangles.add();
And this works fine, creating an inline object, that can further be defined (with anchor point settings etc).
However, it is when I go to use app.paste() or app.pasteInto() that all hell breaks loose.
The line of code I added was:
anchorFrame.content = app.pasteInto();
and the error I get is:
What am I doing incorrectly?
Colin

@Colin – For the paste command you like to use, you have to:
1. First select an object, in your case the added rectangle object
2. Then use the pasteInto() method from the app object
3. There is no content property for a rectangle object
Watch out what is selected after you added the rectangle.
What you have is a selection of the text frame when you start your code in line one.
Adding a rectangle will not change that selection.
The following code will do the job.
However, if you use pasteInto() the pasted objects could be only partly visible inside the frame.
Depends on the size and position of the added rectangle relative to the original copied page items.
Make sure that you give the rectangle a proper size after or while you are adding it:
var frameRef = app.selection[0];
var parentObj = frameRef.insertionPoints.item(0);
//Will add a rectangle sized 40 x 40 mm
var anchorFrame = parentObj.rectangles.add({geometricBounds:[0,0,"40mm","40mm"]});
app.select(null); //Optional
app.select(anchorFrame);
app.pasteInto();
Uwe

Similar Messages

  • Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Frank and All,
    The following answer to your question above is complicated, but I hope it explains why my question was formed with so much frustration in it.
    I have an OpenOffice(OO) Macro that was launched with Calendar at 6pm each business night. It ran properly in all Apples operating systems until I Hit Maverick(OSX10.9). From then on, the AppleScript would run from one to 3 days, then would disappear from the Calendar entry. The Calendar alert would still run, but the "OpenFile" section of the alert would disappear. I also was running elgato EyeTV HD during the day, so I would use energy saver to put my MacBook Pro to sleep at 12 Midnight and wake it again at 9am. I picked up a used Mac Mini to do the EyeTV stuff, provide AppleTV the files in H264 format through iTunes' media share, and found it had plenty of power to do the 6pm automated stuff simultaneously as well. Because I still wanted to run the OpenOffice Macro on my MacBook Pro at 6pm, and wanted to use it for a host of other things when I was on the road, I wanted it to sleep most of the time and only wake up automatically to run the 6pm OO Macro. When I called Apple about the issue I was having with Maverick and Calendar loosing the OpenFile command as part of the Alert Message, they told me the no longer supported answering AppleScript Questions but they now would support Automator questions. I pointed out that the OpenFile would also fail after one to three days if I used a Calendar Alert to launch an Automator App. At first, I did not like Automator, but now I see why Apple is pushing us to use it. Automator adds a TIME STAMP ID to the Apps developed in Automator so the first time you launch the App after a change to it, you must reply to a dialog message saying that this is the first time you are running this version of the App. If a Scammer has replaced your app with one that can reek havoc on your computer, the replacement app will not run unless you are there to agree that you know where the modified app came from and click the OK button to continue (BRILLIANT, Enhanced Security idea on Apples part). I also noticed that after Mountain Lion, the Applescript delay timing was all screwed up as well. Well I tried to use LaunchD Task Scheduler to circumvent the Calendar Problem and that worked until I upgraded to Yosemite Last week. Then LaunchD no longer worked and I am only into a few days of using The Calendar Launched Automator App to see if it will continue to run.
    But I think I solved the dilemma I was having with opening an Automator App in a Sleeping Mac. I Googled up the following question, "AppleScript to wake up computer".  I went thru several complex responses until I found this on that is INCREDIBLE EASEY! What came back was a brettterpstra.com  response from Feb 20th,2014. What it said, in a Quick Tip: caffeinated your Terminal Article,  if you wanted to wake a Mac from sleep, use the Terminal command named "Caffeine -u -t 1". I placed it in an Automator Most Used Action called "Run Shell Script -- Caffeine -u -t 1" and it worked!  Now, I can put my Mac to Sleep but at 6pm, the Automator App will launch, run the "Caffeine -u- -t 1" command and proceed to work as if I had awakened the Mac From Sleep mode by pressing a keyboard key and had run the Automator Script with a double click.
    Sorry for the long, drawn-out reply, but maybe this will help others.

  • I am trying to build a basic TCL skeleton script that reads a remote SNMP OID and displays the value on the screen.

    I am trying to build a basic TCL skeleton script that reads a remote SNMP OID and displays the value on the screen.
    I don't want it to be an EEM Event, I just want to run it from the (tcl)# prompt.
    So I guess I'm asking if you can use cli_exec and other commands in the "namespace import ::cisco::eem::*" in a normal non-EEM script - can I do that?
    This is the error I get:
    OTN.159(tcl)#source flash:TCL_SNMP_Remote_Read.tcl
    invalid command name "::cisco::eem::event_register_none"             ^
    % Invalid input detected at '^' marker.
    What am I missing?
    =================  TCL_SNMP_Remote_Read.tcl  ==============================
    ::cisco::eem::event_register_none
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    if [catch {cli_open} RESULT]
        { error $RESULT $errorInfo }
        else { array set cli1 $RESULT }
    if [catch {cli_exec $cli1(fd) "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0" } RESULT]
           { error $RESULT $errorInfo  }
           else { set SnmpSysDesc $RESULT }
    if [catch {cli_close $cli1(fd) $cli1(tty_id)} RESULT] {
                error $RESULT $errorInfo
    puts $SnmpSysDesc
    =========================================================================
    In the sho-run config I have:
    event manager directory user policy "flash:/"
    event manager session cli username "cisco"
    Any help to get me started would be greatly appreciated!
    Tim

    If you don't want an EEM policy, then don't use any of the EEM constructs.  Instead, all you need is this:
    set output [exec "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0"]puts $output

  • I need a script that will find the computer a user last logged into.

    I am still learning scripting, I need a script that will allow me to pull in usernames from a csv file. Find what computer they last logged into and output that to an csv file.
    I have looked all over and can't find exactly what I need.
     I found the following script but I need  to add the resuitsize unlimited but can not figure out where to put it we have a large environment. Also I need to be able to grab username from a csv file. Any assistance you can provide is appreciated.
    ##  Find out what computers a user is logged into on your domain by running the script
    ##  and entering in the requested logon id for the user.
    ##  This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ##  snapin  http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null){
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username}
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null){
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username}
    get-username resultsize unlimited
    $computers = Get-QADComputer | where {$_.accountisdisabled -eq $false}
    foreach ($comp in $computers)
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
      $Reply = $null
      $Reply = $ping.send($Computer)
      if($Reply.status -like 'Success'){
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username){
    write-host "$Username is logged on $Computer"

    If you are querying by user "resultset size" will be of no use.
    You also have functions that are never used and the body code doe snot look for users.
    Here is what you scrip looks like if printed well.  It is just a jumble of pasted together and unrelated items.
    ## Find out what computers a user is logged into on your domain by running the script
    ## and entering in the requested logon id for the user.
    ## This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ## snapin http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null) {
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null) {
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username
    get-username resultsize unlimited
    $computers = Get-QADComputer | where { $_.accountisdisabled -eq $false }
    foreach ($comp in $computers) {
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
    $Reply = $null
    $Reply = $ping.send($Computer)
    if ($Reply.status -like 'Success') {
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username) {
    write-host "$Username is logged on $Computer"
    I suggest finding the original code then use the learning link at the top of this page to help you understand how it works in Powershell.
    ¯\_(ツ)_/¯

  • Script that will help validate if there is any data loss after a DB restore

    Hi,
    I need to write a single script that will perform the following
    operations:
    1)return me the highy accessed tables across all databases.
    2)List the count, Min and Max system date of the highy accessed tables returned from step 1.
    The idea is to validate if there is any data loss to the highly transactional tables after a database restore operation has been performed.
    Thanks.

    Hello,
    I would also like you to see nice blog by Aron,you can modify the script a bit to change according to your need
    http://sqlblog.com/blogs/aaron_bertrand/archive/2008/05/06/when-was-my-database-table-last-accessed.aspx
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    Hello Shanky,
    The post would not be helpful too much for OP's requirement. The post was talking about when was the database last accessed. DMLs are not capturing in the script and also there will be many variant forms that can be applied for DML. Hence, I do not think,
    the script would help too much. 
    Or Am I missing something? 
    Latheesh as i mentioed OP has to modify the script little bit may be add User_seek,user_update,user_scans.Still IMO there is no *perfect* way to actually analyze this.So I pointed out point in my original post.Also unless he has some timestamp he cannot
    see min time when it was accessed ,max time can be taken from last user seek,scan,lookup time. Motive was to lethim know what he was trying to achieve cannot be axactly obtained by using sys.dm_index_usage_stats.Below query will give most accessed table
    : Source (Query)
    SELECT
    t.name AS 'Table',
    SUM(i.user_seeks + i.user_scans + i.user_lookups)
    AS 'Total accesses',
    SUM(i.user_seeks) AS 'Seeks',
    SUM(i.user_scans) AS 'Scans',
    SUM(i.user_lookups) AS 'Lookups'
    FROM
    sys.dm_db_index_usage_stats i RIGHT OUTER JOIN
    sys.tables t ON (t.object_id = i.object_id)
    GROUP BY
    i.object_id,
    t.name
    ORDER BY [Total accesses] DESC
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Simple script that will export the coordinates (layer bounds - top left x,y)

    Hi,
    I'm looking for a simple script that will export the coordinates (layer bounds - top left x,y) of the layers to an seperate xml/txt file.

    Your screen capture looks like it's from Photoshop.
    In InDesign sub layers are page items, the containing layer has no dimension. So you could get all the page item's x, y, width, height. But you might have to consider groups and then the layering could be very complex. The stacking order could also get complex. Page items have an index, but it's relative to its parent container.

  • "A script that will delete perfstat snapshots older than 90 days with SPPURGE..."

    Hello to all my fine Oracle related friends...We are all one large extended Family...
    I want to create a script that will execute SPPURGE on Perfstat for snapshots that are older than 90 days.
    Now, I have Grid 12c Cloud Control up and running for all the Databases that we have...
    Should I use Grid 12c to execute the SPPURGE and just pass the parameters in like that?
    Or should I go "Old School" and make a Shell Script and schedule it in the crontab?
    What would you guys do?
    I want implement this for 41 "Standard Edition" Databases....some are "Data Guard".....
    Thanks,
    Xevv.

    Xevv Bellringer wrote:
    Hi Ed,
    I tried executing this manually and it's not deleting the snapshots at all.
    begin
    statspack.purge(trunc(sysdate-90),true);
    end;
    I even let it for an entire day and then altered the code like this...But when I execute it, it doesn't deleted the data..
    begin
    statspack.purge(trunc(sysdate-1),true);
    end;
    When I do a select sysdate -1 from dual; it gives the correct date?
    Could there be a "NLS Setting" some where causing this?
    How do you determine that it is not deleteding data?  (please show evidence)
    How, and how often, are you collecting a statspack snapshot?  (please show evidence)

  • I have an alias file that will not delete or drag and it will not open to original file. How do I get these off my Mac?

    I have an alias file that will not delete or drag and it will not open to original file. I have tried everything I know and they still wont delete. Can someone please help me?

    Check out KB Article:  http://support.apple.com/kb/ht1526 You can't empty the Trash or move a file to the Trash 

  • Is there a good texting app for a Macbook air that will sync with my iPhone and iPad iMessage and SMS?

    is there a good texting app for a Macbook air that will sync with my iPhone and iPad iMessage and SMS?

    Hey bishopcheen,
    Great question! Apple has announced that these features are coming in iOS 8 and OS X Yosemite. For more information, check out the “Messages” section of this page:
    Apple - OS X Yosemite - Apps
    http://www.apple.com/osx/preview/apps/
    Messages gives you so many ways to start a conversation. When your iPhone is nearby, you can send a text message from your Mac to groups of friends, even if they use SMS. Or send a photo of your epic karaoke birthday party, then follow it up with a Soundbite audio clip of your encore performance. With Messages, it’s not just what you say, it’s however you want to say it.
    Now every message on your iPhone appears on your Mac.
    Messages on your Mac has always been a great way to stay in touch. But friends without iMessage couldn’t be part of the conversation. Well, now they can be. All the SMS and MMS messages you receive on your iPhone now appear on your Mac. So you can text any friend without picking up your iPhone. And the conversation stays up to date across all your devices.
    iOS 8 and OS X Yosemite are coming this fall. I hope you are as excited as I am!
    Thanks,
    Matt M.

  • What is a good wireless printer that will work with a macbook and windows laptops?

    What is a good wireless printer that will work with a macbook and windows laptops?

    Any printer that visibly supports OS X will work fine. My personal recommendation is Brother, followed rather distantly by Canon.
    Recently I have grown to favor Brother printers over the others. They are inexpensive, their OS X integration is well-implemented, their consumables are reasonably priced, and their technical support is free forever. If you need to call them and explain that you have a Mac, you will immediately receive competent assistance.
    The third and subsequent choices are so far down from those two they're not worth mentioning. I have grown to dislike HP printers, for all the above reasons.
    Read user reviews from vendor websites - Amazon is a good place to start, since Amazon lets people write almost anything they want... right, wrong, or completely idiotic.
    Read the reviews on the respective manufacturers' websites as well, but consider the likelihood of them deleting negative reviews.
    Process all those user reviews employing your own common sense, and draw your own conclusions.
    Consider AirPrint compatibility for future needs. Those features add very little to the price over a USB - only or wireless printer. Understand that not all wireless printers are AirPrint compatible - AirPrint must be specifically indicated. Choose among this list: http://support.apple.com/kb/ht4356
    After OS X compatibility, the next consideration should be the cost of consumables. Laser printers are cheaper than inkjets in that regard.
    Here is a list of AirPrint compatible Brother printers and multifunction devices

  • Is it possible to create a configuration profile that will install multiple network printers and their associated drivers

    Is it possible to create a configuration profile that will install multiple network printers and their associated drivers?
    I was not able to find profile manager on my employer's installation of 10.6 Server. Is this only a feature of 10.7/10.8 server?

    10.6 server does not have profile manager, profile manager is only available in 10/7 and 10.8 server
    for 10.6 server you'll need to use wgm and server admin
    printer management with 10.6, I recommend you read the relevant server manuals regarding
    print server and user management, printer management

  • Is there going to be an update to iTunes Radio that would make it available worldwide and not just U.S. only?

    Is there going to be an update to iTunes Radio that would make it available worldwide and not just U.S. only?

    Hi Laura.
    We're constantly improving HP Photo Creations and we welcome constructive suggestions. Can you provide more detail on the features you want and how you would use them?
    Thank you,
    RocketLife
    RocketLife, developer of HP Photo Creations
    » Visit the HP Photo Creations Facebook page — news, tips, and inspiration
    » See the HP Photo Creations video tours — cool tips in under 2 minutes
    » Contact Customer Support — get answers from the experts

  • Is there any app that will make an Iphone4 work as SIRI does on my 4S. Thanks.

    Is there any app that will make an Iphone 4 work as Siri does on a 4S? Thank you. Bob.

    The closest thing that I know of may be an app called VLingo
    http://www.vlingo.com/
    https://itunes.apple.com/us/app/vlingo-voice-app/id297214191?mt=8

  • Is there an anti-malware add-on that will make Firefox disconnect from the internet by mistakenly clicking on an infected link!?

    Just wondering if there is an anti-malware add-on that will make Firefox disconnect from the internet by mistakenly clicking on an infected link!?

    In order to be able to find the correct solution to your problem, we require some more non-personal information from you. Please do the following:
    *Click the Firefox button at the top left, then click the ''Help'' menu and select ''Troubleshooting Information'' from the submenu. If you don't have a Firefox button, click the Help menu at the top and select ''Troubleshooting Information'' from the menu.
    Now, a new tab containing your troubleshooting information should open.
    *At the top of the page, you should see a button that says "Copy text to clipboard". Click it.
    *Now, go back to your forum post and click inside the reply box. Press Ctrl+V to paste all the information you copied into the forum post.
    If you need further information about the Troubleshooting information page, please read the article [[Use the Troubleshooting Information page to help fix Firefox issues]].
    Thanks in advance for your help!

  • What is the strongest iPad that will work in New Zealand and Australia?  What is the cost plus tax, please?

    What is the strongest iPad that will work in New Zealand and Australia.  What is the cost including tax, please?  Can I purchase this at the Brea, California Apple shop?

    You can see the American retail prices on the Apple website. If you look at 3G, make sure not to get the Verizon model, as it won't work outside of the US.
    Otherwise, sales taxes are different from jurisdiction to jurisdiction, so you'll have to Google to find out the local sales tax in Brea as well as the California state sales tax.

Maybe you are looking for