Placeholders been accessible in Pages via AppleScript
we would like to prepare template files for our users where certain information is filled by data solutions. For the moment we think about to use AppleScript to fill in Pages templates. The Data will be hold in a database solution.
The problem I currently have is how to define placeholders in a pages dokument that could be addressed by an external AppleScript. The only solution I found are textboxes that could be addressed by their indexes. So I am looking for something like variables (AdressLine1, ZIP, City, Total, etc.) that might be adressed by "variable names" ...
regards
Carsten
Create your text boxes with this kind of script.
set les_noms to {"AdressLine1", "ZIP", "City", "Total", "etc."}
tell application "Pages" to tell document 1
repeat with i from 1 to count of les_noms
set un_nom to item i of les_noms
make new text box with properties {name:un_nom, placement:fixed, horizontal position:i * 5, vertical position:i * 5}
I define the object text in an other instruction to show how you will be able to fill the already named boxes
set object text of text box un_nom to un_nom
end repeat
end tell
You will be able to move them exactly where you want in the template.
Then, your script will just have to set the object text of every boxes as I do in the script.
Yvan KOENIG (VALLAURIS, France) mardi 22 mars 2011 18:59:26
Similar Messages
-
How to auto log in via applescript?
I have no idea how to do it? do I need to curl, change html and post? but how do i post then? or how can i fill in password and log in on the safari page via applescript GUI scripting and press enter? I am just so confused right now:(
I have no idea how to do it? do I need to curl, change html and post? but how do i post then? or how can i fill in password and log in on the safari page via applescript GUI scripting and press enter? I am just so confused right now:(
-
I transferred a pages file from ipad to mac (also pages) via email for editing. It opened normally. However, after editing, received message that cannot save edited document to the mac because "trial period has expired for iwork"! I have purchased pages for both machines separately and presumed they would work without a hitch. Am I missing something?
It used to be that to update the trial to the licensed version with the box, you just inserted the DVD & ran the installer to convert the trial to licensed. This changed with Snow Leopard. You now need to delete the trial & then reinstall from the boxed DVD or the Mac App Store. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user.
Yvan Koenig has written an AppleScript that removes the files. You can find it on his iDisk in For_iWork > iWork '09 > uninstall iWork '09.zip. -
How do you "save as" in Acrobat 9 via Applescript?
Greetings all,
I'm using the Applescript Script Editor and trying to do a "save as." The Applescript dictionary for Acrobat 9 has a reference to "save" in the Core Suite, but no matter what I try, I get an AS error that typically contains the text "document 1 does not understand the save message."
I can do a "save as" via Applescripting that GUI but that seems problematic as well (I've set the Properties > Initial View options for document 1 after inserting a page--all via Applescript--but doing a "save as" via the GUI apparently does not save those properties. I would hate to have to script the process of having Acrobat open the file again and reset the initial view; I should be able to do that before saving the new file.
Thanks,
KevinHold down the OPTION key. The Save As option should appear in the File menu.
-
How to expand the folder via applescript?
Dear apple experts,
How to expand the folder via applescript?
Manually we are using command + option + right arrow, but how we handle this in applescript?
Thanks in advance,
Velladurai.GHello
Finder's container's "expanded" and "completely expanded" properties have long been marked "NOT AVAILABLE YET" under OSX:
Finder.sdef > Containers and Folders suite
container n [inh. item] : An item that contains other items
elements
contains items, containers, folders, files, alias files, application files, document files, internet location files, clippings, packages.
properties
entire contents (specifier, r/o) : the entire contents of the container, including the contents of its children
expandable (boolean, r/o) : (NOT AVAILABLE YET) Is the container capable of being expanded as an outline?
expanded (boolean) : (NOT AVAILABLE YET) Is the container opened as an outline? (can only be set for containers viewed as lists)
completely expanded (boolean) : (NOT AVAILABLE YET) Are the container and all of its children opened as outlines? (can only be set for containers viewed as lists)
container window (specifier, r/o) : the container window for this folder
A way to expand a given folder is to use keystroke command of System Events to invoke the keyboard shortcut in Finder. Something like the following script.
kLeftArrowCharCode = 28,
kRightArrowCharCode = 29,
kUpArrowCharCode = 30,
kDownArrowCharCode = 31,
--set f to (path to downloads folder from user domain) -- target folder e.g.
set f to (choose folder)
tell application "Finder"
reveal f
tell Finder window 1
set cv to current view
if cv = column view then return -- do nothing
if cv = icon view then set current view to list view
end tell
my _keystroke(it, character id 29, {option down, command down}, 0.2)
end tell
on _keystroke(_app, _key, _modifiers, _delay)
reference _app : application reference
string _key : character(s) to be keystroked [1]
list _modifiers : list of modifier key to be pressed; enumerations are
command down
option down
shift down
control down
number _delay : post-delay amount [sec]
[1] Character must be present on the current keyboard layout. Otherwise, it is replaced by 'a'.
tell _app to activate
tell application "System Events"
tell (process 1 whose bundle identifier = (_app's id))
keystroke _key using _modifiers
end tell
end tell
if _delay > 0 then delay _delay
end _keystroke
Regards,
H -
Select table to copy as image via Applescript
hi,
Very often I end up copying my tables and then startup Preview and do "New from Clipboard". Has anybody found a way to automate this via Applescript?
There's no starting code by me as I haven't been able to find the command for select table.
Thanks for any reply,
Gerthi,
Very often I end up copying my tables and then startup Preview and do "New from Clipboard". Has anybody found a way to automate this via Applescript?
There's no starting code by me as I haven't been able to find the command for select table.
Thanks for any reply,
Gert -
Disconnect PPPoE via applescript?
Hi,
I've a Wireless router running on bridged mode connected to my Macbook through airport. I've created a PPPoE dialer to connect/disconnect.
Is there any way I could connect/disconnect it via applescript? I want to schedule reboot (reconnect) at 12am and disconnect at 7am. I used telnet for my previous router, but this one has some unknown firmware.
I'd appreciate any help on this. Many thanks.Hello
Firstly I have to say I can only guess, for I don't use OSX10.5 for myself.
I found a seemingly relevant page here:
http://blog.heatery.com/2008/06/how-to-connect-or-disconnect-pptp-vpn.html
It contains sample codes to connect and disconnect PPTP VPN session by using application "System Events" under OSX10.5, which I think you can adapt for your need.
E.g.
--connect PPPoE
(* Code from AppleScript 2.0 Release Notes* )
tell application "System Events"
tell network preferences
tell current location
set aPPPoEService to a reference to (first service whose kind is 10)
if exists aPPPoEService then connect aPPPoEService
end tell
end tell
end tell
--disconnect PPPoE
(* A mixture of code from AppleScript 2.0 Release Notes and code from above link *)
tell application "System Events"
tell network preferences
tell current location
set aPPPoEService to a reference to (first service whose kind is 10)
if exists aPPPoEService then
set isConnected to connected of current configuration of aPPPoEService
if isConnected then disconnect aPPPoEService
end if
end tell
end tell
end tell
If you wish, I guess you may replace this line:
set aPPPoEService to a reference to (first service whose kind is 10)
with something like this line, which lets you refer to service by its name:
set aPPPoEService to service "your PPPoE service name"
Hope this may help,
H -
Passing multiple values to another page via a sql report
Having trouble passing multiple values to another page via a popup SQL report
I have two fields one called "descr" and another called "Met"
when I use the code below all works fine and the value of "descr" is passed
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_TYPE:'
|| descr
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
But when I want to pass another value, all goes bonkers and instead of the value of the field being passed the literal text is passed.
can someone look at my code below and see what may be wrong
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_TYPE,P950_CODE:'
|| descr, Met
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
I appeciate your help looking into this
FYI (Here is the entire SQL for reference)
With t
as
(SELECT
CASE WHEN KEY = 2 then
CASE WHEN WCS_CPT > :P940_METRIC_1_WCS_CPT1 then
'<span style="color:Red; ">'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'</span>' end "WCSCPT",
CASE WHEN KEY = 2 then
CASE WHEN WCS_TOI_PER_FTE < :P940_METRIC_2_WCS_TOI_PER_FTE then
'<span style="color:Red; ">'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'</span>' end "WCSTOIPERFTE",
CASE WHEN KEY = 2 then
CASE WHEN WCS_SIO_PER_FTE < :P940_METRIC_3_WCS_SIO_PER_FTE then
'<span style="color:Red; ">'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'</span>' end "WCSSIOPERFTE",
CASE WHEN KEY = 2 then
CASE WHEN WCS_TC_PER_FTE < :P940_METRIC_4_WCS_TC_PER_FTE then
'<span style="color:Red; ">'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'</span>' end "WCSTCPERFTE",
CASE WHEN KEY = 2 then
CASE WHEN WCS_ADSL_PER_FTE < :P940_METRIC_5_WCS_DSL_PER_FTE then
'<span style="color:Red; ">'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'</span>' end "WCSADSLPERFTE",
CASE WHEN KEY = 2 THEN
TO_CHAR(MONTH,'MON-YY')
else
'METRICS'
end "MONTH"
FROM (
SELECT DISTINCT
ROW_NUMBER() OVER (ORDER BY KEY DESC) AS ROW_NUM, KEY, WCS_CPT, WCS_TOI_PER_FTE, WCS_SIO_PER_FTE, WCS_TC_PER_FTE, WCS_ADSL_PER_FTE, MONTH
from TW_M_KEYMETRICS
WHERE TO_DATE(UPPER(MONTH),'DD/MON/YY') >= TO_DATE(UPPER(:P940_START_OF_THIS_FIN_YEAR),'DD/MON/YY')
ORDER BY KEY ASC, ROW_NUM, MONTH)
WHERE ROW_NUM <= :P940_MONTHS_SINCE_FIN_START)
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_METRIC_TYPE,P950_METRIC_VALUE:descr,MET'
|| ''
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
, max(Met) METRICS, max(Jul) Jul08, max(Aug) Aug08, max(Sep) Sep08, max(Oct) Oct08, max(Nov) Nov08, max(Dec)Dec08, max(Jan) Jan08, max(Feb) Feb08, max(Mar) Mar08, max(Apr) Apr08, max(May) May08, max(Jun) Jun08
from (
Select 'Cost Per Transaction' descr,
decode (MONTH, 'METRICS', WCSCPT) MET,
decode (MONTH, 'JUL-08', WCSCPT) Jul,
decode (MONTH, 'AUG-08', WCSCPT) Aug,
decode (MONTH, 'SEP-08', WCSCPT) Sep,
decode (MONTH, 'OCT-08', WCSCPT) Oct,
decode (MONTH, 'NOV-08', WCSCPT) Nov,
decode (MONTH, 'DEC-08', WCSCPT) Dec,
decode (MONTH, 'JAN-08', WCSCPT) Jan,
decode (MONTH, 'FEB-08', WCSCPT) Feb,
decode (MONTH, 'MAR-08', WCSCPT) Mar,
decode (MONTH, 'APR-08', WCSCPT) Apr,
decode (MONTH, 'MAY-08', WCSCPT) May,
decode (MONTH, 'JUN-08', WCSCPT) Jun
from t
union all
Select 'Total Orders Issued Per FTE' descr,
decode (MONTH, 'METRICS', WCSTOIPERFTE) MET,
decode (MONTH, 'JUL-08', WCSTOIPERFTE) Jul,
decode (MONTH, 'AUG-08', WCSTOIPERFTE) Aug,
decode (MONTH, 'SEP-08', WCSTOIPERFTE) Sep,
decode (MONTH, 'OCT-08', WCSTOIPERFTE) Oct,
decode (MONTH, 'NOV-08', WCSTOIPERFTE) Nov,
decode (MONTH, 'DEC-08', WCSTOIPERFTE) Dec,
decode (MONTH, 'JAN-08', WCSTOIPERFTE) Jan,
decode (MONTH, 'FEB-08', WCSTOIPERFTE) Feb,
decode (MONTH, 'MAR-08', WCSTOIPERFTE) Mar,
decode (MONTH, 'APR-08', WCSTOIPERFTE) Apr,
decode (MONTH, 'MAY-08', WCSTOIPERFTE) May,
decode (MONTH, 'JUN-08', WCSTOIPERFTE) Jun
from t
union all
Select 'SIOs Per Billing FTE' descr,
decode (MONTH, 'METRICS', WCSSIOPERFTE) MET,
decode (MONTH, 'JUL-08', WCSSIOPERFTE) Jul,
decode (MONTH, 'AUG-08', WCSSIOPERFTE) Aug,
decode (MONTH, 'SEP-08', WCSSIOPERFTE) Sep,
decode (MONTH, 'OCT-08', WCSSIOPERFTE) Oct,
decode (MONTH, 'NOV-08', WCSSIOPERFTE) Nov,
decode (MONTH, 'DEC-08', WCSSIOPERFTE) Dec,
decode (MONTH, 'JAN-08', WCSSIOPERFTE) Jan,
decode (MONTH, 'FEB-08', WCSSIOPERFTE) Feb,
decode (MONTH, 'MAR-08', WCSSIOPERFTE) Mar,
decode (MONTH, 'APR-08', WCSSIOPERFTE) Apr,
decode (MONTH, 'MAY-08', WCSSIOPERFTE) May,
decode (MONTH, 'JUN-08', WCSSIOPERFTE) Jun
from t
union all
Select 'Total Calls Answered per FTE' descr,
decode (MONTH, 'METRICS', WCSTCPERFTE) MET,
decode (MONTH, 'JUL-08', WCSTCPERFTE) Jul,
decode (MONTH, 'AUG-08', WCSTCPERFTE) Aug,
decode (MONTH, 'SEP-08', WCSTCPERFTE) Sep,
decode (MONTH, 'OCT-08', WCSTCPERFTE) Oct,
decode (MONTH, 'NOV-08', WCSTCPERFTE) Nov,
decode (MONTH, 'DEC-08', WCSTCPERFTE) Dec,
decode (MONTH, 'JAN-08', WCSTCPERFTE) Jan,
decode (MONTH, 'FEB-08', WCSTCPERFTE) Feb,
decode (MONTH, 'MAR-08', WCSTCPERFTE) Mar,
decode (MONTH, 'APR-08', WCSTCPERFTE) Apr,
decode (MONTH, 'MAY-08', WCSTCPERFTE) May,
decode (MONTH, 'JUN-08', WCSTCPERFTE) Jun
from t
union all
Select 'ADSL Orders per FTE' descr,
decode (MONTH, 'METRICS', WCSADSLPERFTE) MET,
decode (MONTH, 'JUL-08', WCSADSLPERFTE) Jul,
decode (MONTH, 'AUG-08', WCSADSLPERFTE) Aug,
decode (MONTH, 'SEP-08', WCSADSLPERFTE) Sep,
decode (MONTH, 'OCT-08', WCSADSLPERFTE) Oct,
decode (MONTH, 'NOV-08', WCSADSLPERFTE) Nov,
decode (MONTH, 'DEC-08', WCSADSLPERFTE) Dec,
decode (MONTH, 'JAN-08', WCSADSLPERFTE) Jan,
decode (MONTH, 'FEB-08', WCSADSLPERFTE) Feb,
decode (MONTH, 'MAR-08', WCSADSLPERFTE) Mar,
decode (MONTH, 'APR-08', WCSADSLPERFTE) Apr,
decode (MONTH, 'MAY-08', WCSADSLPERFTE) May,
decode (MONTH, 'JUN-08', WCSADSLPERFTE) Jun
from t
GROUP by descr
FrankBorg Species 5618 wrote:
Having trouble passing multiple values to another page via a popup SQL report
But when I want to pass another value, all goes bonkers and instead of the value of the field being passed the literal text is passed.
can someone look at my code below and see what may be wrong
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_TYPE,P950_CODE:'
|| descr, Met
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
Hi Frank,
You should close this parameters with single quotation. Try this -
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_TYPE,P950_CODE:'
*|| 'descr, Met'*
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
Hope this helps.
Regards,
M Tajuddin
http://tajuddin.whitepagesbd.com -
I am unable to printe a document I created on my Mac with Pages via a wired Lexmark X2650 printer. Of course, I have already confirmed that it is correctly set up and connected. Why?
Thank you.
<Email Edited by Host>TextEdit is an application on your Mac.
Type TextEdit into Spotlight (magnifying icon top right on the menubar) to quickly locate and open it.
It is the basic Text/Word Processor (but actually very capable) that comes with all Macs and a good place to test differences if you hit a problem.
Peter -
I have been trying to update via App Store and every time only with apple software it starts to download and it will says it's calculating time remaining then an error message pops up saying " An error has occurred the request timed out. (102)" I have tried everything , I've been told its my ISP but I have tried using differenet internet to attempt the updates. Like I said all other software updates fine its just apple software
http://www.apple.com/support/mac/app-store/contact.html?form=account
-
How do I unmute my mac book pro? I have been listening to netflix via head phones and that works fine. When I now try to listen without the head phones plugged in there is no sound. I look at the lower screen audio symble and it is not muted but the image of the speaker on the top is faded. My daughter was pushing keys. She may have done something.
Thanks
JIf in SYSTEM PREFERENCES>SOUND>OUTPUT the Mute box is not checked, go to Finder>HELP, enter speakers in the upper right hand corner and look for the entry for a hardware test. Run the test and see what the results are.
Ciao. -
How to track user visit my page via search engine(google)
hi there,
is it possible to track that an user visited my page via search engine ( i.e google) using servlet?
what will request.getHeader("user-agent"); return if an user comes via search engine. will it return as "google" or just the browser name. is there any other possible way to distinguish that my page visited via google or user visited my page directly. kindly post your view on this. it will be helpful for most of the projects.
Regards,
A.Check the referrer. This is the URL where the request is coming from.
String referrer = request.getHeader("referer"); // Yes, with the legendaric misspelling.If the user used Google, this will come from the Google domain.
Keep in mind that the client has full control over what it sends along the request, so it could also spoof the referrer value. But at least this solution will cover the majority of the users anyway. -
How do I redirect to a page via a button but also populate a field on page2
I am trying to redirect to a second page via a button but at the same time populate a item on the second page from a function that returns a sequence.
I tried all sort of methods, adding page processing, adding dynamic actions, adding branching and cannot get this to work.
The button must create a new record on the second page, but populate unique key at the same time. Because redirecting does not Submit, adding page processing AFTER submit does not work. I get that, but the following also will not work and I don' know why
Create dummy field on page 1
Create page processing that populates the field via PL/SQL "On Submit"
Create Region button that simply Submits page
Create branch that on submit redirects to second page and moves the value from the dummy field on first page to the field on the seocnd page.
I am new to Application Express and love trying to figure issues out myself but am at a loss with something that should be so simple. Any help would be appreciated.
StewartHi,
As i understand from your requirement,
I am trying to redirect to a second page via a button but at the same time populate a item on the second page from a function that returns a sequence.You want to goto page 2 from page one on click of a button, and when loading the page two you want to populate the item on page two with a sequence number.
if that is the case, try using Button,
Action: Redirect to page in this application
then on page two, create a page process,
Process Point:*On load before header*
Source >> Process >>
begin
select seq_name.nextval into :P2_ITEM from dual;
end;this should do your requirement.
Regards,
Little Foot -
HoW do I save a recording that has been sent to me via text message? Thanks
HoW do I save a recording that has been sent to me via text message? Thanks
You will need a document storage, player, or manager to save the file (DropBox, File Manager, Box, VLC, MoliPlayer for example).
To actually save the file, with it open in iMessage, tap the file icon (lower left) and select the app to save it in. -
I have been sent a .pages document and would like to extract the photos included in the document as jpegs (need to edit on photoshop and put back in), is this possible? can't figure out how to do it.
I'm going to answer my own question:
Easy steps
Locate the document in the Finder.
Control/Right-Click on its icon.
Select Show Package Contents
All images and embedded objects appear in ‘Data’ folder
From this blog
http://vernonchan.com/2013/10/how-to-extract-images-from-apple-pages-5-0-documen t/
Maybe you are looking for
-
Java JCo SAP XI RFC SAP R/3 6.C ... Unicode issue
Hello, My scenario is very simple. I'd like to connect a Java program to a SAP R/3 (MDMP) for RFC calls (in both direction), using SAP XI (some of the RFC calls will redirected to some other systems). I use SAP JCo v2.1.8 and tried with Java 1.4.2_09
-
How to achieve image using digital camera of USB-type interface through IMAQ PCI-1424 board.
1.Is it doable? 2.How to connect USB-type interface with IMAQ PCI-1424 board. Thanks!
-
Keychain password for system chain
inside the keychain file, there is a keychain called system, it stored my wireless password, and there is a keychain call web access,which is now still empty, both are locked, I do not think I ever have a password for them, now I can not unlock it, b
-
Disable IO in java app (not java -D)
I don't want any program to be allowed anything more than a standard applet except when it is specified in a policy. The code (posted below) listens to my policy file when run as an applet but ignores the java.security and java.policy when started wi
-
Hi This is with reference to the earliear thread once agian I am putting my problem in simple way. I have done all CIN setting. I have mentioned the rate in my Tax code for JMOD 100%, JSED 100% JCES 100% and JECS 100%. and accoringly I have maitained