How can I change the "Created by" when making a new file in Xcode 6.x?
Im using Mac OSX 10.10 Yosemite
The old way doesn't work:
Updating the "current" Address Book name.
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions {"FULLUSERNAME" = "Name Here";}
you can try:
System Preferences --> Users & Groups --> choose current User --> unlock -->right tap current User --> Advanced option --> change you full name & above account name to your want, save ,that is ok!
I get it from How does Xcode know who the the project was "created by"? #Juzzz 's answer.
hope that will help.
In Xcode9 Apple added FILEHEADER text macro to allow you to do just that.
Related
do you know why some class things changed after upgrading from 3.1 to 6.3 SP2?
For example our Password fields ... The Format property is Class default - correct is Invisible.
Thanks in Advance for any tips!
Did you first save all your files as text ( .apt ), not Binary ( .apl or .app ) .
Best Tip: Don't use the 'Migration Wizard' .
After saving as Text, you should open each file in TD6.3 to do the conversion. Don't double click from File Explorer to open , but open from within TD itself.
Have done many upgrades this way , and never a problem.
Also , are you running on a TD6.3 certified O/S i.e. not Win XP , else unexpected results in conversion. See Compatibility Matrix to be sure: http://www.guptatechnologies.com/Products/App_Dev/TeamDeveloper/TeamDeveloperCompatibilityMatrix.aspx
Being a 50 mB APT implies you have 'Merged' all the apl's first. ? You cant do this and then convert without loosing settings. - You must save each individual .apl ( and any .app's ) as Text ( do not 'Merge' anything ) . To save each apl as Text , 'Save As' --> Select 'save as Type' --> 'Text( *.apt )' --> your file name will revert to xxx.apt before you Save it , so change it at this point to xxx.apl --> Then click Save. This way your .apl will Save as Text , but with a ',apl' prefix . From past experience , converting ( upgrading ) a Merged file will never work .
Can anyone fix or confirm this behaviour in Xcode (6.3.2):
Ending the name of an iOS project target with ".cc" like "something.cc" automatically adds ".app" to end of the name at runtime…?!
something.cc -> something.cc.app
This is now confirmed by others and obviously a bug: http://openradar.appspot.com/21319069
Thanks to Paul Hemetsbeger there is a workaround: Using the unicode letter "․" fixes the problem. Only the "delete this app alert view" gets a little bit messed up…
I'm'developing a Unity3D game that shows a different (localized) app name in the iPhone's home screen according to the user local language. Note that:
I already know how to localize the iOS app name by editing the Xcode project (create a InfoPlist.string file, localize it, add the CFBundleDisplayName key to it, etc.)
I also know how automatically localize an Android app name within the Unity editor (add a values-XX.xml file with the app_name property onto Assets/Plugins/Android/res/ folder, etc.)
The question is: how can I automatically localize my iOS app name within the Unity Editor so that I don't need to perform the error-prone task 1. every time I build the project?
I think that PostprocessBuildPlayer should be the way to go, however I haven't found any documentation on how to parse it and/or modify the Xcode project file correctly to achieve this.
Long time ago I ran into trouble when I tried to modify info.plist via the Build Player Pipeline especially when doing it in Append mode. It works only once and then subsequent builds fail with "The data couldn’t be read because it isn’t in the correct format." (s. Unity forum posts like this one and my blog posting about this problem) So I decided to take the alternative way combining a customised build with an Xcode Build Pre-action.
Three steps are required:
(1) Xcode setup:
In Xcode go to Edit Scheme / Build / Pre-actions. Then click the + sign to add a New Run Script Action.
In Provide build settings select Unity-iPhone.
Paste . ${PROJECT_DIR}/modify_info_plist.sh (note the dot and blank at the beginning, is ensures that the script is executed in the caller's shell)
So it should look like this:
(2) Script modify_info_plist.sh:
Within your script you have access to all environmet variables from Xcode (s. Xcode Build Setting Reference) and you can manipulate Info.plist using the defaults command (man page). Here is a sample I used to add gyroscope to the UIRequiredDeviceCapabilities:
# Code snippet used in Unity-iPhone scheme as "Build Pre-Action"
my_domain=${PROJECT_DIR}/Info.plist
status_bar_key=UIViewControllerBasedStatusBarAppearance
logger "Start adding keys to info.plist"
defaults write $my_domain $status_bar_key -boolean NO
if [ `defaults read $my_domain UIRequiredDeviceCapabilities | grep "gyroscope" | wc -l` = "0" ]; then
defaults write $my_domain UIRequiredDeviceCapabilities -array-add "gyroscope"
fi
logger "Keys added to info.plist successfully"
(3) Build Pipeline:
Put the following code in a static editor class to create a new menu item Tools / My iOS Build with shortcut cmd+alt+b:
static string IOSBuildDir= "Develop";
[MenuItem("Tools/My iOS Build %&b")]
public static void IOSBuild () {
string[] levels = { "Assets/Scenes/Boot.unity",
"Assets/Scenes/Level-1.unity",
// ...
"Assets/Scenes/Menu.unity"
};
string path = Directory.GetCurrentDirectory ();
path += "/" + IOSBuildDir + "/Info.plist";
if (File.Exists (path)) {
Debug.Log ("Removing file " + path);
File.Delete (path);
}
BuildPipeline.BuildPlayer (levels, "Develop", BuildTarget.iPhone,
BuildOptions.AcceptExternalModificationsToPlayer);
}
I know this is no perfect solution but it's the only one I found to work stable. Two drawbacks:
Step (1) has to be repeated after major Xcode format changes
New scenes have to be appended in the editor class code in step (3)
This script has been working on 10.7 and older, but in 10.8, it seems it's broken. The line:
set theFilePath to ((path to application support from user domain) as rich text) & "AppFolderName:" & UniqueName as string
set theFileReference to open for access theFilePath with write permission
Worked fine on previous versions, but Apple apparently is preventing it from working properly on Mountain Lion. Is there any other way of getting access to that folder via Apple script in Mountain Lion?
Edit: I've included the entire code of the script that will, within a Mail rule export the entire message to a text file that my program can import. The text file is sent to ~/Library/Application Support/MyProgram/MailImport/
Make sure the directory already exists on your machine, as it does here on mine, and the Apple Script doesn't do any checking for it.
This script does not work when path to application support is in the code, but changing it to path to desktop work fine, meaning there is an issue writing to the application support folder, but the code works.
To test, you can create a new rule in Mail, and have Every Message run the script. You have to put the script in ~/Library/Application Scripts/com.apple.mail/
It will then appear as an option in the rules window. You can right-click a message and select Apply Rules to test the script on an individual message.
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with eachMessage in theMessages
set sub to subject of eachMessage
set mid to message id of eachMessage
set sen to sender of eachMessage
set recp to ""
repeat with thisRecpt in recipients of eachMessage
set recp to recp & address of thisRecpt & ","
end repeat
set {year:y, month:m, day:d, hours:hh, minutes:mm} to (date sent of eachMessage)
set dat to (y * 10000 + m * 100 + d) as string
set tim to (hh * 100 + mm) as string
set con to content of eachMessage
set TotalString to "<!STDMessageSubject>" & sub & "<!STDMessageSubject>" & "<!STDMessageID>" & mid & "<!STDMessageID>" & "<!STDMessageSender>" & sen & "<!STDMessageSender>" & "<!STDMessageRecipient>" & recp & "<!STDMessageRecipient>" & "<!STDMessageDate>" & dat & "<!STDMessageDate>" & "<!STDMessageTime>" & tim & "<!STDMessageTime>" & "<!STDMessageContent>" & con & "<!STDMessageContent>"
set UniqueName to do shell script "uuidgen"
set theFilePath to ((path to application support from user domain) as rich text) & "MyApplication:MailImport:" & UniqueName as string
set theFileReference to open for access theFilePath with write permission
write TotalString to theFileReference
close access theFileReference
end repeat
end tell
end perform mail action with messages
end using terms from
There's no such thing in applescript as "rich text". It should only be as "text". In addition theFilePath is a string, so in the next line you need to reference it like this... open for access file theFilePath. Notice the word "file". You need that word there to turn the string into a file reference which is what that command requires.
EDIT: Now that I see your entire code I would write it like this. Your problem still may be a sandboxing issue but at the very least you should eliminate any sources of possible coding errors in your script. This will give you the best chance of having a successful script. If it still doesn't work then it probably is a sandboxing issue.
The basic coding issues that I see are that you are telling Mail to perform all of the commands. Mail doesn't know commands such as "path to application support", "do shell script", or how to write to a file. They're applescript commands so you shouldn't tell Mail to perform them. They are not in Mail's applescript dictionary and thus they may be getting confused when Mail tries to perform them. That's certainly the reason that "text" keeps changing to "rich text" as you mention.
So give this a try. If you still have the problem then at least you know that you've done all you can to eliminate sources of errors in your code.
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with eachMessage in theMessages
set sub to subject of eachMessage
set mid to message id of eachMessage
set sen to sender of eachMessage
set recp to ""
repeat with thisRecpt in recipients of eachMessage
set recp to recp & address of thisRecpt & ","
end repeat
set {year:y, month:m, day:d, hours:hh, minutes:mm} to (date sent of eachMessage)
set dat to (y * 10000 + m * 100 + d) as string
set tim to (hh * 100 + mm) as string
set con to content of eachMessage
set TotalString to "<!STDMessageSubject>" & sub & "<!STDMessageSubject>" & "<!STDMessageID>" & mid & "<!STDMessageID>" & "<!STDMessageSender>" & sen & "<!STDMessageSender>" & "<!STDMessageRecipient>" & recp & "<!STDMessageRecipient>" & "<!STDMessageDate>" & dat & "<!STDMessageDate>" & "<!STDMessageTime>" & tim & "<!STDMessageTime>" & "<!STDMessageContent>" & con & "<!STDMessageContent>"
my writeToFile(TotalString)
end repeat
end tell
end perform mail action with messages
end using terms from
on writeToFile(TotalString)
set UniqueName to do shell script "uuidgen"
set theFilePath to ((path to application support from user domain) as text) & "MyApplication:MailImport:" & UniqueName
set theFileReference to open for access file theFilePath with write permission
write TotalString to theFileReference
close access theFileReference
end writeToFile
EDIT2: try this handler in place of the one in the above code. This may be one way to make the writeToFile handler work because the writing part would happen in a separate process from the applescript. It's worth a try!
on writeToFile(TotalString)
set UniqueName to do shell script "uuidgen"
set theFilePath to ((path to application support from user domain) as text) & "MyApplication:MailImport:" & UniqueName
set theResult to do shell script "echo " & quoted form of TotalString & " > " & quoted form of POSIX path of theFilePath
end writeToFile
EDIT3: if edit2 doesn't work then look here. It seems others have had problems with Mail writing to certain locations and solved it by adding a key to Mail to give it permission.
So it turns out to be a Sandboxing issue. Apple Mail in 10.8 uses a Sandboxed Application Support folder location in general regardless of how hard you try to just get ~/Library/Application Support/, so from an AppleScript within Mail on 10.8
path to application support from user domain
Returns the path
~/Library/Containers/com.apple.mail/Data/Library/Application Support/
From there the MyApplication:MailImport: folders can be created and accessed. Since our actual program that's trying to read the output isn't sandboxed we can just read and access the data from that location for now, as it seems to be working fine.
I am totally new to Android development , recently i bought Lynda.com Android App Development video learning course.
I am facing following problem:
Created new project
Created new xml file with text field only
Then go to Main.xml(that was created by defualt) and replace the default text field with button.
Then go to Main.Java and try calling added button by code "Button b = (Button) findViewById(android.R.id.button1);"
After that I tried to call the setOnClickListner function by " b. " but there is no option with
name of setOnClickListner.
I follow the exact steps as told by tutor in videos .. I am using Android SDK 12 ,Eclipse Indigo and working on Gingerbread 2.3.3. Any solution in this regard would be appreciated
Possible situations:
Make sure you imported android.widget.Button
"Button b = (Button) findViewById(android.R.id.button1);"
Usually it is called:
"Button b = (Button) findViewById(R.id.button1);"
if you have defined the button correctly in the main.xml file. Also make sure you are not importing android.R
I suppose it is a typo but it is actually written setOnClickListener()
Cheers