AppleScript - Get links from one layer

I need to make a list of linked files from one InDesign layer only but can't figure out how.
This is my base that works just fine but gives me a list of all linked files in my document.
set layFilesLinksList to every link of document 1
I have tried this
set linksList to every link of document 1 whose active layer is "Images"
set linksList to every link of layer "Images" of document 1
Any other suggestions?

Thanks!
We are a bit on the way, if i run your script as stand alone i get one of many images in the layer "Images"
But when implementing this code in my bigger script i get nothing.
This works as before, i get every link in my document.
on createMiniature()
  tell application "Adobe InDesign CS5"
  set user interaction level of script preferences to never interact
  activate
  set myLinks to every link of document 1
  -- Images from one layer only workaround --
  tell active document
  if exists layer "Images" then set layerImages to layer "Images"
  set grphicBoxs to all graphics of layerImages
  set myLinks to {}
  repeat with i in grphicBoxs
  set iLink to item link of i
  set pathLink to file path of iLink
  set end of myLinks to pathLink
  end repeat
  return myLinks
  end tell
  -- End Images from one layer only workaround --
  repeat with thisFile in myLinks
  set ruler origin of view preferences of document 1 to spread origin
  set zero point of document 1 to {0, 0}
  set zeroX to 0
  set zeroY to ((page height of document preferences of document 1) + 5)
  set pageHeight to ((page height of document preferences of document 1))
  set pageWidth to ((page width of document preferences of document 1))
  set maxHeight to 13
  set theScale to maxHeight / pageHeight
  set imageXPos to ((item 2 of geometric bounds of parent of parent of thisFile))
  set imageYPos to ((item 1 of geometric bounds of parent of parent of thisFile))
  set imageXPos2 to ((item 4 of geometric bounds of parent of parent of thisFile))
  set imageYPos2 to ((item 3 of geometric bounds of parent of parent of thisFile))
  set imageWidth to imageXPos2 - imageXPos
  set imageHeight to imageYPos2 - imageYPos
  set theName to name of thisFile
  set filePath to ((file path of thisFile))
  set theImgPath to quoted form of POSIX path of filePath
  set imageStatus to ""
  set imageStatus to do shell script ("/usr/bin/exiftool -xmp:Instructions -b " & theImgPath)
  if imageStatus = "" then
  set imageStatus to "Paper"
  end if
  set newBox to (make new rectangle of document 1 with properties {geometric bounds:{zeroY + imageYPos * theScale, zeroX + imageXPos * theScale, (zeroY + (imageYPos + imageHeight) * theScale), zeroX + (imageXPos + imageWidth) * theScale}, stroke weight:0.2, stroke color:"Black", fill color:imageStatus, active layer:StatusLayer})
  set opacity of blending settings of fill transparency settings of newBox to 60
  end repeat
  set the properties of layer StatusLayer of document 1 to {visible:false}
  end tell
end createMiniature
Changing the script to this gives me a blank result with no images
on createMiniature()
  tell application "Adobe InDesign CS5"
  set user interaction level of script preferences to never interact
  --activate
  --set myLinks to every link of document 1
  -- Images from one layer only workaround --
  tell active document
  if exists layer "Images" then set layerImages to layer "Images"
  set grphicBoxs to all graphics of layerImages
  set myLinks to {}
  repeat with i in grphicBoxs
  set iLink to item link of i
  set pathLink to file path of iLink
  set end of myLinks to pathLink
  end repeat
  return myLinks
  end tell
  -- End Images from one layer only workaround --
  repeat with thisFile in myLinks
  set ruler origin of view preferences of document 1 to spread origin
  set zero point of document 1 to {0, 0}
  set zeroX to 0
  set zeroY to ((page height of document preferences of document 1) + 5)
  set pageHeight to ((page height of document preferences of document 1))
  set pageWidth to ((page width of document preferences of document 1))
  set maxHeight to 13
  set theScale to maxHeight / pageHeight
  set imageXPos to ((item 2 of geometric bounds of parent of parent of thisFile))
  set imageYPos to ((item 1 of geometric bounds of parent of parent of thisFile))
  set imageXPos2 to ((item 4 of geometric bounds of parent of parent of thisFile))
  set imageYPos2 to ((item 3 of geometric bounds of parent of parent of thisFile))
  set imageWidth to imageXPos2 - imageXPos
  set imageHeight to imageYPos2 - imageYPos
  set theName to name of thisFile
  set filePath to ((file path of thisFile))
  set theImgPath to quoted form of POSIX path of filePath
  set imageStatus to ""
  set imageStatus to do shell script ("/usr/bin/exiftool -xmp:Instructions -b " & theImgPath)
  if imageStatus = "" then
  set imageStatus to "Paper"
  end if
  set newBox to (make new rectangle of document 1 with properties {geometric bounds:{zeroY + imageYPos * theScale, zeroX + imageXPos * theScale, (zeroY + (imageYPos + imageHeight) * theScale), zeroX + (imageXPos + imageWidth) * theScale}, stroke weight:0.2, stroke color:"Black", fill color:imageStatus, active layer:StatusLayer})
  set opacity of blending settings of fill transparency settings of newBox to 60
  end repeat
  set the properties of layer StatusLayer of document 1 to {visible:false}
  end tell
end createMiniature

Similar Messages

  • Pass value from one layer to another.

    Hey,
    Is it possible to pass a value from one layer to another.
    I have a text that I'll get from layer 1 and I want to pass the value to a TextArea in layer 3.
    Is it possible, anyone?
    Thanks.

    I cannot be sure what you are calling a layer is what I know to be a layer--normally one does not go to layers, one goes to different frames.  If you look at the timeline, it consists of frames and possibly multiple layers.  Every layer has the same number of frames, and content in frame 1 of one layer is accessible by content in frame 1 of any other layer.  So if you have a textfield in layer 1, frame 1, and you have a textarea in frame 1, layer 2, you can use code to have the text in one of those assigned to the other.
    If you show a picture of what you are trying to describe it may help.

  • Is it possible to copy groups/paths from one layer and paste to other multiple layers?

    Note Layer > Duplicate will not work in this regard, because I want to copy one group of paths/elements from one layer to other existing layers, not to a new layer.
    I have not found a command for this, nor have I found any scripts. Note I'm using CS3 but have been thinking about an upgrade.
    Thanks in advance.

    I actually use the Release to Layer (Sequence) function frequently to build my animated steps, for example when animating some text in a way that Premiere won't handle. This releases all the intermediary objects in a transition to new layers, but the background image still needs to be manually pasted into each newly created layer.
    I have read about "Paste to all Artboards," but that feature was not included in CS3. I believe it was released in CS5. Perhaps I need to get an upgrade. Thank you for your kind replies.
    I am a Mac-based CAD user going back to the mid-1990s, and it's interesting how many of the helpful, time-saving features we took for granted in those drawing programs are either not included in Illustrator products or are just being added in recent releases. I would still be using programs such as PowerDraw/PowerCADD if they hadn't gone out of business. Even with some of the expansion packs I've used, Illustrator doesn't hold a candle to PowerCADD.

  • Creating multiple links from one map image in Flash CS4

    I have been tasked with creating multiple links from one map image using flash. Each link would go to the main website page with that location. I assume I could create a button for each location on the map but not having a lot of experience any help / tutorial you know of would be super helpful.. Thanks! Not looking for someone to work me thru it but a little guidance would be great!

    If I was to answer the problem, I would be giving you what you asked not to be given... the solution.  So I'll suggest that you start by researching the getURL() function.  That is what AS2 uses for opening web pages.
    As for coding a button, I'll recommend the following article for you... it will explain the proper approach to coding a button, which will give you an advantage over others who don't follow it, but instead use the way the article says not to.
    http://www.adobe.com/devnet/flash/articles/as_bestpractices_04.html
    Google is one of the best resources available for learning how to do things with Flash--it's the first place I go when I have a wondering.  In general, if you type in the right keywords, you get fairly good search results.  In your case, combinations of "AS2", "button", "getURL", "tutorial" would probably work well.

  • Applescript to delete from selected layer and page

    Hi,
    This is part of a bigger script, but this is where I am having the problem. Hopefully very easy to solve, but driving me mad.
    I want to delete a text box from the active page only, and only from one layer.
    I can get it to work on one layer, but all pages. And on one page, but all layers.
    Could someone please help me write the line to select both active page and layer "slug".
    Thanks,
    Matt
    tell application "Adobe InDesign CS5"
    activate
              set myDocument to active document
              set myActivePage to the active page of the active window
              set myLayer to layer "Slug" of myDocument
              tell myLayer
        tell myActivePage
           ungroup groups
           delete (every text frame whose contents contains "delete me")
        end tell
              end tell
    end tell

    G'day
    It's a hassle, isn't it.
    I've only got CS2 at home, so I haven't had a chance to test this in CS5 — but you need something like this :
    tell application "Adobe InDesign CS5"
        activate
        tell active document
            tell active page of layout window 1
                try
                    ungroup groups
                end try
                set theseFrames to (every text frame whose contents contains "delete me")
            end tell
            repeat with thisFrame in theseFrames
                if item layer of thisFrame is layer "Slug" then
                    delete thisFrame
                end if
            end repeat
        end tell
    end tell
    hope that helps
    m.

  • (v 5.5) I can no longer copy and paste from one layer to another.

    I can no longer copy and paste from one layer to another in Illustrator (5.5). This started happening a few days ago. Restarting Illustrator and also my computer (Mac) didn't help. Any ideas?

    To clarify: If I select an object in layer 1 using command/c or command/x then select layer 2 and press command/v the object gets pasted back into layer 1 instead of layer 2. I've tried everything I can think of and can't correct the problem.
    Now the only way I can get an object from one layer to another is to drag it into another layer in the layers window.

  • I have a 120gb Classic that has no space left on it. i am going to buy a larger gb capacity ipod as soon as i get clearer instruction on how to get the old ipod content to the new ipod. How do you get content from one ipod to the other?

    how do you get content from one ipod to the new one? my content is on an external hard drive not on my pc and i have run out of space on my 120gb classic. can you get old ipod content to new? my itunes has only got short cuts, the real content is on an external drive? can this be done?? please help

    If the content is on an external drive, but your library knows where to find it, then it should all work. Connect your device, make some selections for what to put on it, and sync. If, on the other hand, your current iPod is the only place holding some of your media then see this user tip: Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do I get music from one account to another?

    How do I get music from one account to another? I have music on one account that I no longer use and need to get my music off of it and put it on my new account without repurchasing all my music again

    Click here and ask the iTunes Store staff for assistance.
    (115549)

  • When I use Home sharing, I can see the library I want to copy, but when I highlight the library, the import button does not show up. Also, it will not let me drop and drag. How do I get music from one computer to the other computer?

    When I use Home Sharing, I can see the library I want to copy under Shared, but I can't get it save on the computer under the regular library. I go to edit and "select all" but there is no import button that is in the right hand corner. Also, it will not let me click and drag the music. How do I get it from one computer to the other?

    Since both computers are connected via the network, you could simply copy the ENTIRE iTunes folder from one computer to another via the network.
    If both computers are running Windows, use the Easy File Transfer Utility built into Windows to move iTunes and all other user media/data.

  • How can I get songs from one laptop to another?

    I have all my music from one iTunes, and to put the songs in the iPod and then in the other computer using "transfer purchases" isn't working as it is only transferring apps. That's why I need to get it from one computer to another. Thank you.

    FYI, these articles may be helpful:
    "Troubleshooting Home Sharing": http://support.apple.com/kb/TS2972
    "Understanding Home Sharing": http://support.apple.com/kb/HT3819

  • How do I copy text from one layer to  another?

    I have Googled this but not a single answer seems to work.
    I am using Photoshop CS4 on OS X 10.6.7.
    OK, so  I  have a layer that  has some text in it.  I would like to  be able to  simply copy that  text  from one layer  to  another, but this seems to  be impossible as the Edit Paste menu item is grayed out after I have copied it in to the clipboard.  I can paste it into  the SAME layer, but not into another layer.
    This is how I am trying to  do  this.
    In the layer  with the text, click on the "T" icon to  the left.
    Click on the text, in the layer that I  want to  copy. 
    I select the text (either  by  clicking and dragging or pressing Command-A).
    Next I press Command-C.
    Then I  click on the layer In the Layer Panel) where I want to  paste the text.
    Pressing Command-V is impossible because the Edit-Paste menu option is grayed out!!!!
    WHY??????
    Perhaps more importantly, HOW do I copy text  from one layer to  another?

    First thing you can simply right click on the Text Layer and choose Duplicate Layer.  But that will create a new Text Lay
    er identical to the one you have.
    To answer your question in your case....  Create the Text Layer.   Make a New Layer.  Or have the layer you want to paste into visible.
    Highlight the text layer in the Layer Palette and Ctrl+Click (Win) Cmd+Click(Mac) so that you see marching ants walking around your text.
    Edit>Copy.
    Then highlight your Layer you want to paste into and hit Edit>Paste or Cmd+V / Ctrl+V.

  • How do I get songs from one Mac to another?

    How do I get songs from one Mac to another?

    iTunes for Mac: How to copy purchases between authorized computers
    Regards.

  • Can't get playlists from one one computer to another.  Confident Home Sharing is turned on correctly.  Have imac and macbook Air and Lion.  Using smart lists.

    Can't get playlists from one one computer to another.  Confident Home Sharing is turned on correctly.  Have imac and macbook Air and Lion.  Using smart lists.

    Using Ethernet, I am attempting to stream the movies on my computer to my girlfriends computer through iTunes home sharing. I want to watch the movies that are on one computer on another.

  • How do I copy and paste vector art from one layer to another, keeping all of its attributes?

    When I copy a vector shape from one layer to another, the shape picks up the color attributes of an existing shape in the second layer (or sometimes only the outline of the shape appears). What to I do to avoid this from happening (I just just want to paste the shape in its original form and color)?

    OK - I guess this is a little more difficult than I imagined...
    Merge Layers rasterizes all the vector shapes - I want all the shapes to stay as vectors in the second (pasted) layer.
    Merge Shapes changes the color of the copied vector shape - I don't want to change the color
    Shape Layer via Copy [Ctrl] +[J] copies the layer containing the vector shape, but doesn't paste it into the second layer
    Any other ideas? Or, is it possible that PhotoShop doesn't support varied colored vector shapes on the same layer? I am coming from an InDesign background, and there was no issue having many different (colored) vector objects on the same layer.

  • Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

Maybe you are looking for

  • KT3 Ultra-ARU battle

    Hello! I have a Pentagram Dark 56I modem (Lucent win modem) installed on MSI KT3 Ultra-ARU. Everything is working now except my modem witch does not connect to the internet (only one out of fifty connections is successful). I haven't got any idea wha

  • Reporting output

    I am trying to produce a report in cf using a simple query, select * The output looks something like this : Ticket No Name-1 Name-2 Name-3 ======= ====== ======= ======= 12345 Smith 12345 Jones 12345 Brown I would like the output to be one line only,

  • Solaris is not joke actually

    emm, as a administrator of FreeBSD, it is clear that during the installation of Solaris 10 in DELL server, the interactive installing mode with the X window is greate even though not meet linux guys. what's more, installed Solaris 10 in my old box -

  • Allow Updates box in Average  cost type

    Dear all In a Multi-Org environment, in the Cost Types Window, CSTFDCTP, (Navigation Path: Cost/Setup/Cost Types), i try to check the Allow Updates box in Average cost type i get the following message: FRM-40200: Field is protected against update. I

  • Coupling  INNER  JOIN   with   FOR  ALL  ENTRIES  statement

    Hi  All,      I   am  coupling   INNER  JOIN  with  FOR  ALL  ENTRIES  statement  .....      Would   you  please  highlight  its  implications ??   Is  it  a  best  practise ?       Is  it  advicable  to  use  MULTIPLE   INNER  JOINs  with  a  FOR  A