iPhone - How can I right align PSTextFieldSpecifier of settings bundle - iphone

I've settings bundle in my iPhone application. How can I right align the PSTextFieldSpecifier value?

This worked for me. If you open the property list (Root.plist) file as a source and paste the following for each entry you want right-aligned:
<key>IASKTextAlignment</key>
<string>IASKUITextAlignmentCenter</string>

Have the same desire. What I currently do is to put some space bars after my title. So I have to text fields in my settings, Account and Password:
Account TheName
Password *****
now I would count the chars that I need to get the same length of both strings. In this case the "Account" label has one char less then the "Password" label. So I would put the remaining characters count twice and append them to the label. In this case the label would be "Account " (2x " ")
following I will replace the " " with "_" so that you can see the difference
Account__ TheName
Password *****
It looks different sized in your XCode Settings Bundle but on the device or in Simulator it will be fine

Related

Swift : get text from safari (AppleScript)

I have no experience with Swift , but my organisation don't want anyone to run AppleScript anymore.
I'll be alright using swift though
I was hopping to be able to get text from safari on a desktop swift app
for e.g
property leftEdge5 : "class=\"value\">"
property rightEdge5 : "</span>"
tell application "Safari"
set TheTransactionIDGraber to do JavaScript "document.getElementsByClassName('field emphasizedid')[0].innerHTML;" in current tab of window 1
end tell
set transactionID to ""
set theText to Unicode text
set theSource to TheTransactionIDGraber
try
set saveTID to text item delimiters
set text item delimiters to leftEdge5
set classValue to text item 2 of theSource
set text item delimiters to rightEdge5
set transactionID to text item 1 of classValue
set text item delimiters to saveTID
transactionID
end try
set the clipboard to "PID: " & transactionID
is they an easy way to do the same with Swift ? or get swift to run a basic applescript and store the value ? perhaps in a plist file

Get string within a specific string

Please excuse the stupid question, but I am an absolute freshman in Crystal Reports.
I would like to add a plaintext to Crystal Reports. The problem is, if a hyperlink has been inserted that contains a display text, it will be displayed as follows:
HYPERLINK "http://google.de/https://www.google.com/webhp?hl=de&sa=X&ved=0ahUKEwipsMvN_-vkAhWCEVAKHf3JBCIQPAgD " google.com
I just want the hyperlink to be displayed within "
The result should be https://www.google.com/webhp?hl=de&sa=X&ved=0ahUKEwipsMvN_-vkAhWCEVAKHf3JBCIQPAgD
However, it is also possible that "hyperlinks" that do not contain a hyperlink may occur.
My professor has created an Access database that contains texts and hyperlinks and I have to display the hyperlinks correctly.
Some lines of the database:
HYPERLINK "http://votetandem.org/" votetandem.org
HYPERLINK "https://app.votetandem.org/"votetandem.org
Sometimes there is a space between "URL" display text and sometimes not
Use the REPLACE() function. Hit F1 for online help.
I found a solution for my problem. I created a formular field. chr(34) is " in ASCII
If InStr({TABLE},"HYPERLINK " & chr(34)) > 0 Then
Split({TABLE},chr(34))[2]
else
{TABLE}
the URL is the second entry. The first is Hyperlink, second real URL and the third the displayed name.

AppleScript Error Code -1700

This is the error that pops up when I try my script out:
Script Error ---- Can’t make {button returned:"Enter", text returned:"testing"} into type Unicode text.
I'm trying to have users enter a Username so that they that have their Documents folder be linked to a file server.
I have that part separate but now on this part of having the user input their username so when I have ln -s /Volumes/Drive/Documents Documents the username will automatically pull from the script and input it by itself so the Documents folder and File server could be linked.
Basically trying to make it to where the user doesn't have to go into the terminal and link the two together. I'm not sure why the error code is popping up other than it is probably having to deal with the set Username part of the script so not completely sure.
set Username to (display dialog "Enter your NetID Username" default answer "" buttons {"Cancel", "Enter"} default button 2)
tell application "Terminal"
activate
do script "'ln -s /Volumes/Drive/Documents Documents'" & Username
end tell
return input
The error message
Can’t make {button returned:"Enter", text returned:"testing"} into type Unicode text.
is pretty clear.
display dialog returns a record, not a string so you have to write
set Username to text returned of (display dialog "Enter your NetID Username" default answer "" buttons {"Cancel", "Enter"} default button 2)
Or if you need to handle the button and the returned text write
set {button returned:buttonReturned, text returned:textReturned} to display dialog "Enter your NetID Username" default answer "" buttons {"Cancel", "Enter"} default button 2

Add Variable Hyperlink in Mail Merge in Word 2013

I'm trying to add a hyperlink to a mail merge field. So something like this:
{HYPERLINK "{MERGEFIELD "Links" }"}
So I create a field like this.
{ MERGEFIELD Links }
And the above works (it displays different links for different recipients).
However, when I go to Edit Field, and then attempt to add HYPERLINK to { MERGEFIELD Links}, Word will not allow me. Meaning that when I type HYPERLINK followed by a space, the "variable" field is gone. Instead of word displaying...
LINK
it displays...
{HYPERLINK "{MERGEFIELD "Links" }"}
even after I press "update field". So Word is not letting me enter HYPERLINK for some reason.
How do I solve this?
From the Microsoft Web Site,
On the Insert menu, click Field (under Quick Parts in later office versions).
In the Field names list, click Hyperlink,
and then click OK. The text Error! Hyperlink reference not valid
appears in the document.
Press ALT+F9 to open the { HYPERLINK \* MERGEFORMAT } field code.
Put the insertion point after HYPERLINK and then add a space.
On the Insert menu, click Field. In the Field names list, click MergeField. In the Field name text box, type the name of the data source field that contains the hyperlink, and then click OK. For example, if the name of the data source field is "Address1," the field code appears as follows: { HYPERLINK { MERGEFIELD "Address1" } \* MERGEFORMAT }
Press ALT+F9 to close the field code. You now have Error! Hyperlink reference not valid text.
Put the insertion point at some arbitrary place in the middle of the Error! Hyperlink reference not valid text, and insert the text you want to appear. If you would like a merge field, insert that from the "Insert Merge Field" option on the menu.
Delete the remaining text of Error! ... before and after the text you want to keep.
Note: If your merge field only contains an identifier, with the URL to be provided as a static part of the merge document, this can work also. On Step 5, you will need to insert the URL text as well as the MergeField, for example:
{ HYPERLINK "https://www.myurl.com/EditForm.aspx?ID={ MERGEFIELD ID }" \* MERGEFORMAT }
I also have been struggling with this. What I found to be the key is creating the document from SCRATCH and not saving it before executing the mail merge. Here are the steps I used:
open a new document and click on the step by step mail merge wizard; add your generic text.
To add the variable hyperlink go to insert>quick parts>fields
select hyperlink on the left and click okay
Use alt + F9 to see the hyperlink field code
Type “” and between them insert your merged field so that {HYPERLINK \* MERGEFORMAT} -> becomes {HYPERLINK"{MERGEFIELD"Constructed_URL"}"\*MERGEFORMAT}
Press ALT+F9 to hide the field code
Click in the text "Error! Hyperlink reference not valid" and replace with something generic like click here.
Complete the mail merge BEFORE you save the document.
Hope this helps and good luck!
Start with the process here:
http://support.microsoft.com/kb/912679
However, like user1867326 indicated, the hyperlink (which should be variable with the mail merge) is converted into a static link when the Word file is reopened.
A solution that seems to work is adding a bookmark within the hyperlink field code immediatly after the mergefield.
{ HYPERLINK { MERGEFIELD "Link" } \* MERGEFORMAT }
Click between the } and \ and go to INSERT > Bookmark, give it a name, and this seems to prevent Word from replacing the mergefield with a static hyperlink.
This answer is adapted and hopefully clarified from the clever solution described here:
Mailmerge dynamic hyperlink fields lost after save/reload of document - Word 2010
This is what worked for me for an email mail merge with variable hyperlinks that all display the same text. I am using Office 2016 Word.
Put the insertion point where you would like the link display text to be in the document.
On the Insert menu, click Quick Parts, and select Field.
In the Field Names list, click Hyperlink, and then click OK. The text Error! Hyperlink reference not valid appears in the document.
Press ALT+F9 to open the { HYPERLINK * MERGEFORMAT } field code. 5. Put the insertion point after HYPERLINK.
On the Insert menu, click Quick Parts, and select Field. In the Field Names list, click MergeField.
In the Field name text box, type the name of the data source field that contains the hyperlink, and then click OK. For example, if the name of the data source field is "Address1," the field code appears as follows: { HYPERLINK { MERGEFIELD Address1 } * MERGEFORMAT }
Press ALT+F9 to close the field code. You now have Error! Hyperlink reference not valid text.
Put the insertion point just before the period in ‘Error! Hyperlink reference not valid text.’ and delete all the text except for the period. Write in the link display text. Make sure not to delete the period (this is important).
To check that the hyperlinks are mapping, right click on the link display text and click edit hyperlink. You will see the correct link in the address field for each record.
I like to style the period text color to white so it looks invisible.
I have had limited success with the other suggestions - basically, Word is buggy in this area. There is a simple alternative - indeed the only alternative AKAIK if you want the hyperlink to vary AND the text that is displayed to vary too (not an unreasonable requirement).
Note that this only works for DOCUMENT MERGES, not for EMAIL MERGES, since it relies on processesing the output document.
The trick is to add a place marker (text that serves as an ID) wherever you want a hyperlink. Insert this via a regular mergefield. In your table of source data, you need columns
place marker, text_for_display, hyperlink
You then need to put your source data into Excel (if that isn't where you have it already) and put this formula
="Set Rng = ActiveDocument.Content: Rng.Find.Execute FindText:="""&[place marker]&""": ActiveDocument.Hyperlinks.Add Anchor:=Rng, Address:="""&[hyperlink]&""", TextToDisplay:="""&[text_for_display]&""""
into a blank column in the first row, and fill down.
You need to amend [place marker],[hyperlink] and [text_for_display] to the appropriate cell references.
If the [hyperlink] includes a query string, you may find you want to build it using a formula, based on other data in the source.
The resulting formulae can then be pasted into a macro and run on the output document.
You may then want to use the "Robbins/Mayor" macro http://www.wordbanter.com/showthread.php?t=18346 to split the generated documents.
I got this working thanks to this thread, but then it stopped working and I figured out why so I thought I'd say thanks by posting what I discovered here.
The issue is that word has a special type of curly brace. Copying the code text from this thread may not work for that reason. To get the curly braces Word wants, I used Fn + Command + F9 on my Mac running Catalina and Office 365. Apparently some Mac users may find Command + F9 works -- just test to find out. I'm sure Windows has a similar keystroke set. I found the Mac solution in this post.
Also, the syntax that works for me is: { HYPERLINK { MERGEFIELD "url" } * MERGEFORMAT } where "url" is the label of the column with the link in my Excel file. Note the position of the quotes. This differs from other posts here (I tried the other combinations) but I wouldn't be surprised if the syntax may vary across Word versions and operating systems.
To get this method to work in Mac Office 365 (Big Sur), you need to know about the Toggle Field Codes in the context menu. The shortcut above to replicate the Alt-F9 behavior will create a new field, instead of allowing you to edit the field that exists.
At these steps:
Press ALT+F9 to open the { HYPERLINK * MERGEFORMAT } field code.
OR
Press ALT+F9 to close the field code. You now have Error! Hyperlink reference not valid text.
Instead of the keyboard shortcut, right click on the error message and select Toggle Field Codes from the context menu.
Answer worked great for me with this adjustment! Thank you!

Displaying contents corresponding to the word entered in a text box in ipad app

I have plans to create an app which gives me the list of words and sentences associated with the text which i entered in my text field.Ok let me elaborate.I have a dictionary in my project consisting of words and probabily some sentences and then i have a text box.Whenever i enter some word in that text box say i enter "Rose" ,then words corresponding to the word like "Rose","Roses","Rose is beautiful" etc (these words and sentences will be in dictionary)must be shown onto the list and when any of the word or sentence is selected then that must be displayed on the text box,Just like the case of google search engine ,where we type a word and we get the list of words and sentences containing that word.
So anyone having anyidea about this,please give me thedirection from where to start.
Thanks,
Christy
When u finished typing the word in the text field, search your dictionary to see if the word is present. If the word is present add the results to an array or something and use it to display it on a table view. When the user clicks on it then you can use the info to display on a text view.