Close an Indesign library using Applescript?
I've been trying loads of different ways to close an Indesign Library pane from within an Applescript.
I've been able to create a library (thanks Shane!) but have tried every which way imaginable to close it (albeit from a separate script).
I've tried:
close library
tell library window
close
tell library
set visible to false
tell library panel
etc
etc
etc
Searching the web has come up with nothing. Is it me being stupid ?
Tried that thanks Kasyan, unfortunately it didn't work:
"Adobe InDesign CS3 got an error: Can’t get library \"12345678_library\"."
This is the problem I've been getting each time.
I'm wondering if it's something similar to having to use "unlink" and not "embed" when actually embedding graphics in the indd
Just a thought - do I need the fullname of the library, that includes the path to the directory it is saved to?
Similar Messages
-
How to move an aliased based library using AppleScript
I wanted to move all my pictures from one disk (NAS) to a external disk (Device) directly connected to my Mac. This to improve access speed of all my media.
Since I have set up my library as a reference library iPhoto has created Alias to all my pictures on my NAS disk. As I want to move I need to change these alias to point to the new Device disk.
I could have imported all my pictures again, but then I would have lost all my albums. I did not look forward in re-organizing 15K in pictures. Looking into various discussions on different forums I created this Apple Script. I struggled a lot to egt the correct syntax and commands, used some stuff form other posts, thanks for this!
For every alias in a certain directory it creates a new alias with the same name however pointing to the pictures on my Device Disk. It deletes the old alias and renames the new alias to the original name. I am not sure if this is a smart thing to do, but it seems to work fine.
set f to choose folder
ProcessAlias(f as string)
-- replacess all alias files in the passed folder path (string)
on ProcessAlias(this_folder)
-- get list of folders in this_folder
set utid to AppleScript's text item delimiters -- store old delimiters
set AppleScript's text item delimiters to {return}
tell application "Finder"
set folder_listing to every folder of folder this_folder as string
end tell
set AppleScript's text item delimiters to utid -- restore old delimiters
if folder_listing is "" then
set folder_list to {}
else
set folder_list to paragraphs of folder_listing
end if
-- process folder_list
repeat with sub_folder in folder_list
ProcessAlias(sub_folder) -- send each folder back to this subroutine
end repeat
-- get list of alias files and process them
tell application "Finder"
set alias_files to every file of folder this_folder whose kind is "Alias"
repeat with this_alias in alias_files
set origitempath to original item of this_alias as text
--display dialog origitempath
set orig_name to name of this_alias
set AppleScript's text item delimiters to "NAS"
set textitemlist to every text item of the origitempath
set AppleScript's text item delimiters to "Device"
set newitempath to the textitemlist as string
set AppleScript's text item delimiters to " "
set newalias_file to make new alias file at this_folder to new_itempath
delete this_alias
set the name of newalias_file to orig_name
end repeat
end tell
return -- you can return a listing of moved originals if you want
end ProcessAlias
When running this scrip make sure you make a backup of your iPhotoLibrary.Welcome to the Apple Discussions.
I could have imported all my pictures again, but then I would have lost all my albums.
You can convert your referenced library to a managed one. Use AliasHerder to replace the alias file in the library with their source files thus converting the library to a managed library.
Also send a feature request to Apple for better ways to use a referenced library and use NAS drives. The more requests the better.
Keep us posted as to the reliability of your method. The upside to all this is that if you run into problems later on you won't lose your source files, only the organizational effort you've put into the library.
OT -
How to enable the script label of a text frames in indesign using applescript
hi all,
am using Indesign CS2 with applescript..
Using script I have to open a template in indesign and flow the word document into it...
I can able to flow the word document into the template using "Place" command..but script labels of the text frames gets disabled...
I need the script labels to be enabled...
can anybody help me
thanks in advanceScript labels can't be disabled, so I'm not sure what your problem is -- perhaps seeing some code could help. Could it be that you're referencing a page item by label, but it is not responding because the item is part of a group?
Shane Stanley <[email protected]>
AppleScript Pro Sessions <http://scriptingmatters.com/aspro> -
Setting options in "Printer" section using Applescript InDesign CS
How can i set define supplementary options found in the "Printer" section of the InDesign dialog box in a print preset using Applescript?
I would like my script to set duplex option with the proper binding, according to the page orientation.
When creating print presets manually, these extra options are stored in the print preset, but I can't find how to access them thru Applescript.
Thanks,
PeterShane,
Thanks for your reply, but it is not yet clear to me.
I know you can set some print properties in the Apple Print event, such as copies, collating, target printer ...but how can I adress the printer-specific options, such as duplex printing? Could you give me a sample line of code?
And next step, how can I include this "Apple -print" setting in an InDesign Print preset using Applescript? I suppose I have to set the apple printer prefs before creating the InDesign preset. Right?
Thanks in advance,
Peter -
How to set xml tag to nothing in indesign using applescript?
Hi guys,
I need set xml tag to nothing(for tables) in indesign using applescript.
Please help me.Hi,
tell application "Adobe InDesign CC 2014"
tell active document
if (count of story) > 0 then
tell story 1
if (count of tables) > 0 then
tell table 1
set tag_name to associated XML element ----------------> i can't get xml tag, i am receiving the xml tag is nothing.
if (tag_name = nothing) then
display dialog ("This table has no tag")
else
set markup_tag to markup tag of tag_name
set n to name of markup_tag
display dialog ("Tag name is " & n)
end if
end tell
end if
end tell
end if
end tell
end tell
I can't get xml tag for table, i am received nothing -
How to: Close "Getting Playlist" using applescript ?
Hi *,
How is it possible to close the iTunes "Getting Playlist" Pop-up window using applescript ?
Take a look at --> http://www.cronomik.org/t1.jpg
I have tried to do the following, but iTunes doesn't act.
tell application "System Events"
tell application "iTunes" to key code 53
end tell
Any ideas of how to fix my question ?
StefanI have got it working with this script.
If iTunes Pop-up a message, I press a key on my remote control and the Pop-up message / Box disappears.
tell application "System Events"
tell process "iTunes"
-- get the front window's name
-- get the name of the front window
set whichWindow to (get the name of the front window)
-- Ergebnis: "Getting Playlist"
-- display dialog result
-- display dialog whichWindow
-- Ergebnis: {button returned:"OK"}
set whichButton to (get the name of the front window's button)
-- Ergebnis: {"Stop"}
tell whichButton of window whichWindow to key code 53
-- set the contents of the button to key code 53
end tell
end tell
In a terminal I have typed in "while true; do ./diut.app; sleep 2; done" to see what happend, if iTunes is front most and an iTunes message Pop-up.
Solved by myself. -
Can an iTunes shared library be 'loaded' using applescript
When looking at iTunes shared libraries they either have a triangle on the left of the library name or not. If you click on the library name then the triangle appears if it wasnt there before. This may take some time to happen and whilst it is going on iTunes states that the library is being 'loaded'.
If the library isnt loaded then i get an error -1728 if i try any access to it, otherwise i can access the library without problems.
Is there a way of 'loading' the library using AS ?
This script illustrates and the open statement doesnt work but was my attempt to load the source
set shared_library to "iBook Music"
tell application "iTunes"
set source_list to (get every source)
set source_names to (get name of every source)
try
set playlist_count to (count of playlists of source shared_library)
on error errMsg number errNum
if errNum is -1728 then
log "* The source is not 'loaded'"
open source shared_library
else
log "* " & errMsg & errNum
end if
end try
end tell
Message was edited by: Guy FaciusYes, although there are a couple of things to check and do.
First of all, when the iPod is connected to iTunes, look on the Device/iTunes U pane and make sure that Sync iTunes U is ticked ON and that the options below the tick-box are set as you want them. (Mine are automatically include all items of all collections.)
After the Sync has finished, look on the iPod:
audio - under Playlists/iTunes U. (No, I've no idea why they should be only there...)
video - under Video Playlists/iTunes U or Video/Video Playlists/iTunes U. (Still no idea why...)
One point to note, if the video is in a format that the iPod cannot play, then of course, you won't find it on the iPod, but if you have set it to Sync to the iPod, you should see a message at the end of the Sync process informing you that they haven't been transferred. -
Quicktime save using applescript
i have a lots of movies of various sizes and formats that I want to standardise.
I want 720x400 size in the same format as recorded (i.e. no transcoding). I can do this manually using quicktime by re-sizing the movie then saving as a self contained movie.
I know this does'nt actually resize the movie it just puts it into a .mov container that tells quicktime what size to "play" it at next time............
anyhow I`m happy with this solution. And looking at the quicktime library in applescript I see there is a " save self contained" command..... cool!
however I have coded this code:
set infile to choose file with prompt "select file:"
set outfile to choose file name with prompt "Save altered file here:"
try
tell application "QuickTime Player"
activate
close every window
open infile
set dimensions of document 1 to {720, 400}
tell document 1
save self contained file outfile
end tell
-- save document 1 given «class dfil»:file outfile, «class
savk»:self contained
close document 1 saving no
end tell
end try
The save line that is commented in currently does nothing, I don't really understand why.
The save line commented out, gets further by bringing up the save as window in Quicktime but i have no way of selecting save (automatically), I have tried to command a button click via the system events call (which works for other apps), but the script seems to be stalling at the save line, i.e. the button click is never executed.
anyone got any ideas?
cheers
Stevesorry code came out wrong
set infile to choose file with prompt "select file:"
set outfile to choose file name with prompt "Save altered file here:"
try
tell application "QuickTime Player"
activate
close every window
open infile
set dimensions of document 1 to {720, 400}
tell document 1
save self contained file outfile
end tell
-- save document 1 given «class dfil»:file outfile, «class
savk»:self contained
close document 1 saving no
end tell
end try
Message was edited by: Steven Prigg -
How can I change the font size of an outgoing instant message using Applescript?
Text copied into Messages.app from a web page is often too small to read. Is there a quick way to boost the font size using Applescript?
HI,
I have spent some time looking at the Mix Message Case.scpt in Hard Drive/Library/Scripts/Messages and also Crazy Message Text.scpt in the same Scripts Folder but then the Mail one.
Both are Apple versions.
The Mix Case one is set in Messages > Preferences > Alerts
Set the top drop down to Sent Message
Enable the Applescript items and chose the Mix Case item.
It will look something like this in the current Font and size you have set.
ThEn aGaIn
Obviously you don't want all the bit to make the font change between upper an lower case but it does have the option to use it with the Sent Message and it also uses the entry in the text field as a String.
The Mail Crazy Message one opens a dialogue box when run.
it has a default phase and some Upper and lower limits to the size that will be used.
the Dialogue allows you to change the phrase and also "Set Prefs" to altert the font sizes.
The result is a text palce in a new Mail items and the font and size changes to look like this:-
Picture
It will look different everytime and the Font for each character and the size of each is randomised.
Although I have tried sticking in a line to change the size to anything other then my set font in the Mixed Case one I can't get it to work.
In some cases I get an Script error in Messages (It seems to think I am setting a Font called "10")
At other times it just says it can't set it buit still does the Mixed Case bit.
My hope was to change the size and then reduce the requirement for the "intercaps" routine.
I have other emails about new posts so I will anwser them and then spend some more time on this.
9:01 PM Thursday; June 13, 2013
iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.4)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad
"Limit the Logs to the Bits above Binary Images." No, Seriously -
How to Add a page Item in Indesign Library Panel
Hi All,
I am trying to add page Item in Indesign Library Panel using
ILibraryCmdUtils::ProcessLibraryAddItemCmd()
But it shows the message of Heap corrupt while processing the commmand.
Can any one help me out with some code snippet ?
Pete. M. MitchelHi,
Iwas also suffering fro the same problem.
Better to use "ILibrarySuite::DoAddToLibrary()" method.
Hope it will help you. -
How to find and replace using AppleScript for TextWrangler?
I ran into a problem after exporting my book into EPUB from Indesign CS4. In this book the Latin diphthong æ is used. Unfortuately it didn't translate very well into the EPUB or corresponding XHTML files. Is there a way to do a batch change using AppleScript to change these symbols √¶ into æ which is the code for the diphthong? If so, how?
I also have an issue with the symbol †, in some of the documents it appears as this ‚Ć. Can I do a batch change for that as well? If so, how?
I'm new to using AppleScript so I appreciate all of the help. Thank you so much!!Hello
Here's some observations -
æ = U+00E6
= <c3 a6> (UTF-8)
= <c3 a6> (MacRoman) = æ
† = U+2020
= <e2 80 a0> (UTF-8)
= <e2 80 a0> (MacRoman) = †
which likely mean that your source data is text in UTF-8 but destination (or viewer or intermediate converter) is interpreting the data as text in MacRoman.
Make sure you properly declare the encoding of XHTML or EPUB document as UTF-8.
Good luck,
H -
How I generate index markers using Applescript and tagged text!
One of the challenges I've faced in automating the book making process using Applescript with inDesign is that there don't seem to be any AS commands for making new index markers (anyone please correct me I if I'm wrong about this).
I've tried various js scripts which do an OK job, but they don't make the actual native markers. This means you have to wait until the book (consistiing of multiple ID files) is complete (so that all the page numbers have been established) to generate the index.
Recently, I read a tweet from someone with a link to a technique which uses tagged text and find and replace with GREP to edit the tags, inserting the tagged text index tags in the text file and then re-placing the text file in the ID page. In itself, this works great. But I'm dealing with literally thousands of separate text frames, none of them connected in a story.
The books typically consist of around 1200 pages with almost that many people, each of whose names I need to index with "Lastname, Firstname" references. And those particular strings don't (can't) appear anywhere on the pages. There will also be about 50 ID files all combined into one book. So it is imperative that I have ID generate the native index markers. To help keep things straight and efficient, I'm creating separate small text frames to hold the lastname, firstname strings. I created an object style for these frames which sets the attributes to "nonprinting", and I place the frames in the margin.
Then I realized that I don't actually have to have ID export the tagged text files for each. I exported one prototype and copied its tags to properties in my script, and then I concatenate them with the respective list item values I import from the database.
At the proper point in the page building script, I tell "textwrangleer" to make a new document, set its contents to the index string for the current record, save it to disk, overwriting the previous one, and then tell ID to "place" it in the index text frame, which generates the ID index mark.
I actually got an AS error when I first tried this: "file doesn't exist" or some such. Then I realized that the "place" command was happening too soon, so I inserted a .5 sec delay in the script, and it worked.
This is actually my first major script for actual work, and I'm so excited about it! I promises to cut production time down to about a thenth of what it was.
I still have to add some logic to branch between handlers with slightly different parameters for five different page formats, but the same page building handler will work on all of them.A note on this:
Daniel Swanson wrote:
I've tried various js scripts which do an OK job, but they don't make the actual native markers. This means you have to wait until the book (consistiing of multiple ID files) is complete (so that all the page numbers have been established) to generate the index.
These scripts typically search for words and immediately write out the page numbers they are found on -- one shot indexing.
The solution is to add both the topic and its page reference to the current document's index:
if (app.activeDocument.indexes.length == 0)
app.activeDocument.indexes.add();
app.activeDocument.indexes[0].topics.add(app.selection[0].contents).pageReferences.add(app.selection[0]);
The first lines only make sure there is an index to add to (per default, a new document has none).
The last line adds a selected word to the index (it must be a plain text string, hence the use of its 'contents'), and then adds a reference to the selection in the text itself.
Adding the same word a second time will for a change (quite untypically for ID's Scripting) not result in an error but simply add another page reference to the existing one.
When doing this in a loop: remember to work backwards, because the index marker itself gets inserted into the running text, and that will throw off your text indices. -
Importing XML using AppleScript in CS5.
Hi, totally new to inDesign but do programming and database work. I am looking to import an XML file created from our database. I can do a basic import manually after creating document and importing xml to load tags then creating text box element and tagging it and placeholder text. Now trying to automate using AppleScript. Found some samples from inDesign but not sure how to tie all the pieces together. Does anyone have a simple example that takes a small XML file and loads a few records automatcally into indesign. Maybe, create new document, create textbox element and create text placeholders and tags then import xml file?
Thanks,
JoeI don't work in applescript, but:
Does anyone have a simple example that takes a small XML file and loads a few records automatcally into indesign. Maybe, create new document, create textbox element and create text placeholders and tags then import xml file?
Err, when you say "records," you have me slightly concerned.
Because it is quite difficult to get Data Merge -like functoinality with XML.
Have you tested (and validated!) this workflow withoutscripting? -
Using AppleScript to launch an application on a different machine
Hi there,
I'm trying to use AppleScript to enable a couple of my Macs to talk to each other.
On one machine, I want to use this script:
tell application "Finder" of machine "eppc://user:[email protected]"
launch application "Rivet" of machine "eppc://user:[email protected]"
end tell
to have the other machine launch Rivet, a video server that I can access from the PS3/iPhone/iPad
everything seems to work without issue (i.e. no errors), except it doesn't do anything.
I see a line written to the console on "helium":
9/23/10 18:48:30 com.apple.AEServer[3535] launchproxy[3535]: /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Versi ons/A/Support/AEServer: Connection from: xxx:xxx:xxx:xxx:xxx:xxx%en0 on port: 60571
every time I run the script on the other machine, but, like I said, nothing else happens.After much searching and trial and error I finally discoverd Hiroto's suggestion from way back in 2001. It is the only solution I have found that actually works to launch/activate any application on a remote Mac using an applescript on a local Mac.
I have one Mac Mini running household control applications Indigo and iRed. I wanted to use embedded AppleScripts in those applications to launch and control PandoraBoy on another MacMini that I use as a media center. I discovered that you cannot activate an application on a remote Mac unless it's already running. (Only God and Apple know why!) And, of course, if you want to launch and application--it's usually NOT running!
But the following works:
set remoteMachine to "eppc://RemoteMachineName:[email protected]"
tell application "Finder" of machine remoteMachine
open ("/Applications/PandoraBoy.app" as POSIX file as alias)
end tell
THANK YOU HIROTO!!!
Once the remote app is actually launched/activated you can then send AppleScript commands to it as follows:
set remoteMachine to "eppc://RemoteMachineName:[email protected]"
using terms from application "PandoraBoy"
tell application "pandoraboy" of machine remoteMachine
playpause
end tell
end using terms from
I have also learned that the application to be controlled on the remote machine must also be present on the local machine and "using terms from" must also be used in the control script for this to work. -
How do I back-save a CS4 InDesign library file to CS3?
Any ideas anyone?
I have an InDesign library, originally created in CS3, but since updated in CS4.
I need to distribute this to colleagues using CS3; they can open the library fine, but cannot drag items from the library to the page.
Any suggestions would be appreciated as I'm pulling my hair out on this one (even though I've got no hair to start with!).
Cheers,
MartinMartin,
A work-around: Open CS4 and the library. Drag objects out. Drag to desktop or Bridge. Open CS3, thus producing xml snippets. Drag snippets from Bridge or Desktop into CS3. Drag objects into a CS3 library.
Cheers,
Mike Witherell in Maryland
Maybe you are looking for
-
"iTunes can not run because some of the required fields are missing. Please reinstall iTunes." What the ****? Please help me figure this out. I already removed quicktime (as another thread suggested). I can't get in!
-
How to create dynamic ON CHANGE statement? Please help!
Hi Experts, I have a requirement where my ON CHANGE criteria is dynamic. It is based on wa_charakeyfrmt-value which I am reading from a table. If it is 'DO' then ON CHANGE will have wa_errtabcopy-DO. Else if it is 'LI' then ON CHANGE will have wa_
-
Stacked canvases - best settings for Visible / Raise on Entry
Hello, I'm currently migrating a Forms 6i client-server application to 10.1.2.0.2 WebForms. I'm familiar with the advice that, to minimise network traffic, tabbed canvases should be changed to use stacked canvases with Visible=No, Raise On Entry=Yes.
-
Hi, I am trying to download the cs6 master collection for my windows laptop and i keep getting a message saying i have close adobe bridge down. how do i do this, because ever time i click the link it gives me a eroor 404 and i dont know what to do. m
-
Class not found., Eclipse
Hi erveryone. I wanted to use some classes in my eclipse project. So i made a jar archive. And added as a external library. So now i dont get any compile error when im using classes in my project. But when i want to run the code i get Class not Found