InDesign Scripting Guide/Apple Script
The command
set myTop to top of margin preferences of myPage
described in the InDesign Scripting Guide doesn't work with Indesign CS2. Does anyone can help?
Thanks
Hi Morenga 65,
Try:
tell margin preferences of myPage
set myTop to top
end tell
But, as Dave says, do come to the Scripting Forum--there's lots of good stuff there!
Thanks,
Ole
Similar Messages
-
Scripting Guide referenced scripts
All over the CS3 scripting guide there are parts of scripts and it says
in parentheses (for the complete script, see ...). Where do I find these
scripts that are being referenced to?Hi Fred,
You can download the scripts from here:
http://wwwimages.adobe.com/www.adobe.com/products/indesign/scripting/downloads/indesign_cs 3_guide_scripts.zip
Kasyan -
Un Anchoring objects in Indesign CS2 Using Apple script
Hi all,
I need to Un achor the object. I have the script which will un anchor the Text Frames but in case of
Rectangle i'm not able to unachor. My script will find out the Anchrored Text Frames and place its
contents to its position and then delete the frames. I can find out the Anchored Rectangles but i
cannot get its contents. Can anyone help me out to do this?
Thanks,
JacinthaHi,
I can select the page item ,If i ask for page items and its parent. but not getting its contents.
-- aframe is text frames in document
set Conts to paragraphs of page item i of aframe
set contents of first insertion point of parent of page item i to Conts
I need to get the contents of anchoring objects and place it in its position and then delete the anchoring object. Tried working on above code but not able to get its contents. Any solution? -
Hi Friends,
I am new to Indesign Scripting by Apple Script. As a beginner, I am trying to do some basic scripting in Indesign by Apple Script.
My aim is to disable the option of "Overprint [Black] Swatch at 100%" in Indesign. This option is available when we go to Indesign ---> Preferences----> Appearance of Black.
Also, if a user opens a file, in which the swatch is already enabled, then it should prompt him for disabling.
I can make a display dialog in AppleScript. But, I am bit unsure as how can I go ahead and disable this option. I tried this below script:
tell application "Adobe InDesign CS4"
tell every layout window to set overprint preview to false
end tell
However, it is changing the view option to overprint preview.
Appreciate your help and suggestions!
Thanks,
Abhishektell application "Adobe InDesign CS5"
tell the active document
set overprint black of document preferences to false
end tell
end tell -
Hai all,
i am trying to insert footnote and its contents for a particular xml element in "Adobe Indesign cs2" thru apple script. But i'm facing some problem. I'm able to select the xml element and its contents and i can insert footnote for that element and i can cut that contents but i couldn't paste this contents in footnote. I have tried with the following code:
tell application "Adobe InDesign CS2"
tell active document
set theRoot to (item 1 of XML elements)
end tell
end tell
myLoopLoop(theRoot)
property myLoLoV : {}
property myHoHoV : {}
on myLoopLoop(myElement)
tell application "Adobe InDesign CS2"
tell active document
set moreElement to every XML element of myElement
repeat with x from 1 to (count of moreElement)
set em1 to item x of moreElement
select em1
if (name of markup tag of em1 is "informalexample") then
set em2 to em1
select text of em2
tell insertion point 1 of em1
set myfootnote to make footnote
end tell
tell application "Adobe InDesign CS2"
set myselection to selection
cut (selection of active document)
end tell
tell application "Adobe InDesign CS2"
tell insertion point 1 of myfootnote
paste into myfootnote
set text of em2 to myfootnote
end tell
end tell
end if
tell me to myLoopLoop(item x of moreElement)
end repeat
end tell
end tell
end myLoopLoop
Can anyone help me out to sort this problem?
Thanks
anbu
I Mac Mac OS X (10.4.8) Intel based Machi all
any help
thanks
anbu -
Access indesign files using a script
> If you want to do it as a learning exercise, however, one can
> understand that.
Particularly since that's now what I want to do myself. I make one ID
file with "His name's Tom.", "His name's Dick." and "His name's
Harry." on three lines, and another file similarly with "Her name's
Mary.", "Her name's Betty." and "Her name's Sue." "Tom" and "Sue" have
the character style "Client" applied. So how to script the extraction
of the "Client" names and write them to "clients.txt" on the Mac
desktop? I'm now trying to do that with AppleScript. It seems very
basic and shouldn't take long.Shane Stanley wrote:
>> (1) I couldn't get theFile set to "clients.txt" on the desktop.
>>
>> set theFile to (document file "clients.txt" of folder "Desktop" of
>> folder "Home" of folder "Users" of startup disk of application
>> "Finder")
>
> That's a Finder reference, but you're not in the Finder here.
Durn!
> Just use a colon delimited path, or something like:
>
> set theFile to ((path to desktop) as text) & "clients.txt"
I did try to do that, but apparently I did something - several things -
wrong. I remember I did get a colon-delimited path to work, but then
I couldn't get the names to copy to it right.
What is path to desktop other than text?
>> (2) I couldn't figure out how to get the script to append to the end
>> of the had-to-be-chosen "clients.txt" file rather than replacing its
>> contents.
>
> write theNames to theFile starting at eof
Oh, I thought eof was something specially in the Scripting Guide menu
script. Trying again, whatever...
Not yet, I'm afraid. The previous script still works:
tell application "Adobe InDesign CS4"
set find text preferences to nothing
set change text preferences to nothing
set applied character style of find text preferences to "Client"
set theFinds to find text
set theNames to ""
set theFile to choose file
repeat with j from 1 to (count of theFinds)
set theNames to theNames & item j of theFinds & return
end repeat
open for access theFile with write permission
write theNames to theFile
close access theFile
end tell
Only adding "starting at eof" it should still work... and it does.
But I'm anticipating trouble when I (again) add your line in place
of "set theFile to choose file"... Actually I pretty much know it's
not going to work, since I directly copied the line before - so why
don't I try the colon-delimited version this time:
set theFile to " Great Royzito:Users:Home:Desktop:clients.txt"
Right?
But no, this gives exactly the same error alert as your line,
that it can't make the string into type file. And then afterward,
oddly, if I run it again it says "Adobe InDesign CS4 got an error:
File Great Royzito:Users:Home:Desktop:clients.txt is already open."
So the string apparently serves to open the file, but not to write
to and/or close it. What do you make of this? Something else that
broke or is different in CS4, perhaps?
The file seemed to close only when I quit all applications and
force-quit the Finder. Is there a better or quicker way to do it
than that?
Thanks,
Roy -
ARD 3: Saving tasks as Apple Script
I'm trying to cut out some repetitive tasks with Apple Remote Desktop 3 by using Automator. I use a number of tasks on a daily basis with my network of computers. I'd like to save the tasks as Automator Scripts or Apple Scripts so that other network administrators can perform these same tasks. I use the "save task" feature of ARD 3, and I know that I have limited functionality within Automator. If I could just save my tasks as Apple Script, the I could just program Automator to run the scripts - I could even get iCal to do it for me!
Thanks,
Woody AdamsHere are a few:
http://www.automator.us/ard/
You might also find this article helpful:
Creating Automator Actions for Apple Remote Desktop -
Hi Everyone,
I was just wondering that if I have created a script using Apple script recorder button and it does what I have wanted. Now I was just wandering that how would I save it so that when I click on it, script will run and do what it suppose to do?
Thanks,Hi Colin,
Thanks for your reply. I was able to record some of the action and when I have tried to execute that using apple script editor and it works fine. But once I saved that script using .scpt extension and then tried to click on it then it just opened the script editor but did not run without click execute. Do you know why?
Thanks, -
Apple script to enable/disable dark menu bar and dock when sunsets/sunrises
Greetings,
Regarding the new dark menu bar and dock function in Yosemite. Would it be possible to write a script that would enable this function at a certain time say sunset and to disable it at another time say sunrise?
If so, is there anybody who could possibly help me write such a script or atlas point me in the right direction please?
Many thanks in advance
G_DAlthough you can set or remove the Dark interface style with defaults write syntax, the reset back to default (non-dark) interface will require a log-out/log-in cycle to entirely remove the Dark style. Toggling this style on and off in the System Preferences > General panel does not require the preceding log-out disruption. Unfortunately, other than possible GUI scripting, the Apple Script dictionary in Yosemite is very limited with respect to System Preferences access, and enabling/disabling the dark interface style.
-
When i run an applescript it does it's job (runs a shell script) but then hangs up and i have to force quit it. Is there a shell script or apple script i could run to tell it to force quit without knowing the number of the running process? This is as i would like to not have to find out the process id number each time i run the script as it changes each time...
thanks - 7;^')There are two elements here.
First, AppleScript is, indeed, waiting for the process to finish before ending itself, so the first step would be to have AppleScript not wait for the process to end and return control immediately.
In order to do that you need to add some addition elements to the shell command, specifically " > /dev/null 2>&1' before the trailing &, like:
<pre class=command>do shell script "/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.a pp/Contents/MacOS/ScreenSaverEngine -background >/dev/null 2>&1 &"</pre>
These additional elements suppress the output of the command (which you don't care about anyway) and allows AppleScript to continue while the shell command continues to execute in the background.
For the kill element there is an additional part, echo $!, you can use that returns the PID of the command just executed. You can store this and use it later to kill the process.
This example launches the screensaver for one minute, then kills it.
set myPID to do shell script "/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.a pp/Contents/MacOS/ScreenSaverEngine -background &> /dev/null & echo $!"
delay 60
do shell script "kill " & myPID
You could also use killall, but since this kills processes by name, not PID, you run the risk of killing other processes at the same time. -
Running shell scripts/apple scripts without dock icon?
Is there anyway to hide the ugly dock icon when executing shell scripts (or apple scripts)?
I have a script I execute every time as a login item, and it bounces in the dock whenever I log in. Is there any way to hide it ?
Thanks,Thanks to both people who answered.
You both gave me useful workarounds to my problem.
Renaming the scripts to be 'foo.command' was very hepful and useful to know. I tried this and it does indeed work. I may use this in the future.
I also had a play around with applescript and the automator to achieve similar results.
I agree that double clicking to run the file and also edit it is mutually exlcusive - I'm sort of trying to work out how I could make it do 'either/or' as I choose. In the Windows world i'd have the option of setting 'open' to run the script (assuming I'd got cygwin installed and had assiciated it) OR 'Edit with vim' if I wanted to edit the file (assuming vim was installed!).
Unresolved issue is that I'm still unable to get VIM to be associated with a .sh file.
The way I would envisage it working in Mac world would be to be able to right click on foo.sh -> Open with... and have a list to select from immediately there like..
Text Edit
Vim
Terminal (default)
and be able to somehow add and remove apps from the list and change which is the default.
My issue is that I don't seem to know how to get other apps than TextEdit to appear in the list - I suspect I need a better understanding of how these file/application associations work and are configured.
Regards
Mark -
When i run an applescript it does it's job (runs a shell script) but then hangs up and i have to force quit it. Is there a shell script or apple script i could run to tell it to force quit without knowing the number of the running process? This is as i would like to not have to find out the process id number each time i run the script as it changes each time...
thanks - 7;^')Post to the AppleScript forum under OS X Technologies. IIRC, you can add a quit to the script after some delay time.
-
How to check indesign version installed by Apple Script
Hi Friends,
I want to make an apple script which will check for the version of Indesign installed in the "Applications" folder.
I tried using "exists" function of Finder. But seems something is missing/incorrect.
tell application "Finder"
exists application file "Adobe InDesign CS4" of folder "Applications"
end tell
Please can you suggest.
Thanks,
AbhishekHi Niel,
Thanks for your email.
Basically, I need to check whether a user has which version of Indesign on his mac like (CS3, CS4 etc)
Accordingly, I have to create different loops.
I have CS4 installed on my mac but when I run the below
tell application "Finder"
exists version of application file "Adobe InDesign CS4" of folder "Applications" of startup disk
end tell
The result is false.. even though I have CS4 installed. And, if I try
get version of application "Adobe InDesign CS4"
It gives o/p as "6.0.6.622"
Thanks for your help!
Abhishek -
Find raster Image & Vector image in adobe indesign using apple script?
Find raster Image & Vector image in adobe indesign using apple script?
Find raster Image & Vector image in adobe indesign using apple script?
-
XML Comment in Indesign using Apple script.
Hi all,
How to find the selected XML element is commented in indesign and get XML comment value in thru apple script. Any Ideas?
-JacinthaYou can have as many comments as you want so they require you to state the index of the comment in your reference.
Assuming you have an object reference for the XML element, you would replace "associated XML element of selection" with that.
tell application "Adobe InDesign CS3"
set myComments to {}
if every XML comment of associated XML element of selection is not {} then
set end of myComments to value of every XML comment of associated XML element of selection
end if
return myComments
end tell
if you know there's only going to be one comment then,
tell application "Adobe InDesign CS3"
if every XML comment of associated XML element of selection is not {} then
set myComment to value of XML comment 1 of associated XML element of selection
end if
return myComment
end tell
~Mike
Maybe you are looking for
-
I have been using Elements 8 ever since it came out, and all of a sudden the cropping tool has changed: I can no longer crop horizontally or vertically, only diagonally. The up/down/side arrows have disappeared! Please help if you can, I'm no longer
-
I recently upgraded from Acrobat Pro version 7.0.9 to version 8.1.2 (Windows XP Pro). In many cases, when I "Convert current web page to an Adobe PDF file" using the Adobe PDF toolbar in Internet Explorer, the spacing between lines is much larger wit
-
JDeveloper 9.0.3.1 is very slow
Hi, I have installed 9.0.3.1 and created the project from scratch. Previously I was using 903 which was very fast in bringing up my application in normail.debug mode. Now it is behaving very slow. the only difference is I am using CVS for my source c
-
Allowing popup exception for local javascript files ("file://")
I use Firefox to write local applications on my laptop. When doing so the URL always begins with file:///. When a local document is opened the output of document.domain is "domain." If I disable popup blocker my local html based application creates a
-
Overall Best Security for the WRT54G v8
I bought the WRT54G v.8 and wanted to know if anyone out there knows the best way of securing this router from leechers and hackers. I just read a book that details how to hack into wireless routers (scary) and I understand that there are layers of s