Can I Mass Re-link Files in InDesign? Same Name, Just New Extension? - adobe-indesign

I've got a document that has several dozen photos that I've kept in .psd until i was done editing. Now I've shot myself in the foot as I'd like to re-link all of these to the .tif version. (Easy Photoshop batch). The file names would remain the same, just the extension changes.
Is there a way to do this without having to manually re-link each photo? I'm thinking even a script maybe?
Thanks for your time. -Joe

Solution!
In the Links panel (Window > Links) select your images and from the menu in the top right corner (the 4 lines) select Relink File Extension.

Related

Can I mass replace hundreds of references to files in Xcode 6?

I have an iPad app and I've recently replaced hundreds of PNG's with JPG's to reduce the project size. Now Xcode is rightfully complaining that there are 1000's of missing file references. I can easily select the file, edit its properties and change .png with .jpg and All is Fine. However I will be an old man when I'm done.
Is there a way to mass replace all missing references in the project? Or can I mass remove all missing file references so I can re-add them?
Yes, edit your project file manually, using BBEdit or some other text editor with a search and replace feature.
Right click on the whatever.xcodeproj file (which is really a folder), and select Show Package Contents, in there, you'll see a project.pbxproj file. Edit this file in your editor, and do a search and replace for png to jpg or whatever. You can get fancy with your search and use a regex to select specific paths if you like, rather than doing every png file. That only matters if you still have some png's in the project.

How do I access images (for document icons) in an asset catalog in the Xcode 5 product preference editor

I think I'm literally on the last step before submitting a new Mac app, and I've been banging my head against a wall for the past few hours on what I think should be really, really easy.
I've designed document icons for the two different types of icons my app creates and works with. I created a new "Icon" in Images.xcassets, and dropped the appropriate files into the drop zones.
In the product editor -> Info, I go to where the document type information is, but when I try to enter in the icon name in the "icon" field of either the Document Types or Exported UTI section, the icon image just turns into a question mark—no options show up in the drop down menus for icons.
How do I get the images/icons in the asset catalog to show up in the editor? Alternatively, if I was going to enter that manually into the plist, what sort of format would I use to reference an Icon file from the asset catalog?
I know I'm probably missing an easy step here, but I can't see it!
To my knowledge, Xcode doesn't currently support using .xcassets for document icons. This is a little strange—the .xcassets editor clearly allows you to create new icons, but it doesn't generate .icns files, it just puts all the files in the same folder and uses a plist to manage them.
To create an icon for your document types, upload the 1024x1024 version of the icon to http://iconverticons.com/online/ to convert it to a .icns file. Alternatively, you could use a third-party tool to generate an .icns file with different images for different resolutions. There used to be a great tool included in the Developer Tools for doing this, but I can't seem to find it anymore.
Once you've got an icns file, add it to your project and you should be able to select it as the "Icon" for your Document Type or External/Internal UTI. Enjoy!
To be honest, it might be worth filing a bug about this. Xcode's development seems so strongly driven by iOS these days, they may not have noticed this yet!
I did it in the most easy way:
Add "New OS X Icon" to images.xcassets and name it "DocIcon", for instance.
Drag and drop images of your document icon
Just type "DocIcon" to icon name of your document
You will see question mark as document icon thumbnail. Don't care about. All will work fine after build and launch of application.
This is what worked for me, using Xcode 10 in 2019 (none of the other answers worked in my case):
Select asset catalog in Project Navigator
Right click on the left pane (list of assets) and choose App Icons & Launch Images ▶︎ New macOS Generic Icon (second option from bottom). Name it "Document". This will create a folder named "Document.iconset" in the asset catalog directory.
Populate all entries with your custom images. They must all be of the appropriate size (e.g., "16 x 16 #2x" must be 32 x 32 pixels, otherwise you will get yellow a warning icon over the image slot).
Navigate to the asset catalog folder, and use the command: iconutil -c icns Document.iconset (must match the name of the icon created in step #2). I took this command from Apple's documentation here (which by the way, also says some BS about Xcode "automatically creating an .icns file from your .iconset folder on build". Sure...).
Copy the newly created Document.icns file as a resource to your project.
Select the target, open the Info pane, and in both Document Types and Exported UTIs set your .icns file as the icon for the file type.
Hej, allesamme,
I had the same problem and have been researching it for days. I found a family of four solutions, the first three of which did not work for me: 1. using a .png file as the document type icon file; 2. using a manually created .icns file as the document type icon file; 3. the above solution, and 4. what I will describe here. Only the last one worked for me.
I tried following the spirit of the above advice and found that it didn't work, at least for my MacOS app. I'm on OS X 10.9.2 (13C64) running Xcode Version 5.1 (5B130a).
The current wisdom seems to be to create a directory in your workspace with a lower-case name and .iconset extension, in which one puts files with an icon_ prefix and the usual suffixes (16x16.png, 16x16#2x.png, 32x32.png, etc.)
In Product Editor's Info pane you can go into Document Types and associate the .iconset file with the Icon field. The icon image happily displays something reasonable. The build process builds a .icns file from that spec and copies it into your app.
I had an intermittent problem that the .icns file wouldn't build, which I traced to mistakenly haven included a 64x64 icon in the list. That's a no-no.
The current Apple dogma on this issue can be found in the official documentation, which covers some details I glossed over here. I didn't need to edit the Info.plist file directly: everything seemed to work from the interfaces provided in Xcode.
I have no idea which solutions work in which contexts, but thought I'd add throw more alternative on the fire for people to try out. — Jim Coplien

How do I add an icon to my Xcode project?

I have an Xcode project for Mac OSX, and I'd like to add an icon file (.icns) to my project and set it as the App Icon. How would I do this?
The key here is that you need an ICNS (icon set) file.
The right way to create this is described in the Human Interface Guidelines, and the details are covered in various user's guides and reference guides in Apple's maze of twisty little documentation, but I'll summarize it here.
There are third-party tools that can do this, as well as plugins for Photoshop, GIMP, Illustrator, etc., that can output a correct .icns file. But make sure, if you use such a thing, it's up to date, because Apple changes the rules all the time.
If you need to do it manually, here's what you do:
First, create a set of PNG files at different sizes. The exact list of what you need changes over time. See Provide the Correct Resources and Let OS X Do the Work if that link lasts longer than the current list; otherwise, search for it at http://developer.apple.com yourself. But, as of early 2013, it's 512x512, 256x256, 128x128, 32x32, 16x16, and #2x versions of each. All of them should have the sRGB color profile embedded in them. They should be named either icon_512x512#2x.png, icon_512x512.png, etc., or MyApp_512x512#2x.png, MyApp_512x512.png, etc. Put them all in a directory together named, e.g., MyApp.iconset.
"But wait! I just want an icon, I don't want all those sizes!" Well, you really do want all those sizes. Your 512x512 icon will look horrible when scaled down to 32x32. And on a Retina Mac, when your icon gets scaled up to double resolution, instead of getting sharper it'll just get jagged. Also, if you want to get into the App Store, Apple will reject you if you don't have them. But, if you insist, you can get away with just putting icon-512x512.png in the folder, and follow the rest of the steps, and it will work.
From the Terminal, cd into the parent directory, and type iconutil -c icns MyApp.iconset. You will get a file called MyApp.icns.
Now you can do the steps suggested by Douglas, and it will actually work. In Xcode, select your project in the Project Navigator, select your app target in the project sidebar, select the Summary tab, and drag MyApp.icns from Finder to the App Icon box.
This may not have any visible effect in the GUI, except to add MyApp.icns to the Project Navigator. In other words, you may still see the "?" icon. This seems to be a bug in Xcode 4.5. If you follow the out-of-date recommendations from the HIG two versions ago, Xcode always shows the icon, but if you follow the current HIG, it doesn't. Go figure. Hopefully Apple will fix that some day.
But for now, it doesn't matter. Build the project, and then look at MyApp.app, and it will have your icon in the Finder, on the Dock, etc.
Now, I know you don't want to draw the same picture in 10 different variations, you just want something simple. As long as you don't want to get into the App Store, you can get away with cheating, in two ways:
Scale the 512x512 (1024x1024 pixel "512x512#2x" if supporting hi res) image to all of the other sizes, using your favorite tool.
Create a .icns with nothing but the 512x512 image in the iconset.
The second one is simpler, and less cheat-y, and ultimately Finder is probably going to scale your 512x512 image as well as you would have anyway.
Finally, if you've manually edited your Info.plist or changed build settings (or you're using a project imported from a much easier version of Xcode), just dragging the image may not be enough. If you need to do the same steps manually, here they are:
MyApp.icns has to be in the Project Navigator as a file in your project. (You can drag it here from Finder.)
In Build Phases, the Copy Bundle Resources should include MyApp.icns. (You can drag it here from the Project Navigator.) (If you're not using the normal Build Phases for some reason, you need some other way to get it copied to Contents/Resources/MyApp.icns at build time.)
Your Info.plist should have an Icon file (raw name CFBundleIconFile) named MyApp, with no extension.
That's all there is to it.
In the project navigator, select an asset catalog.
Choose Editor > Add Assets > App Icons & Launch Images > New OS X Icon.
An empty OS X icon set is created, with an image well for each image representation in the set.
Drag icon file from the Finder to the appropriate image well in the set viewer.
Alternatively, you can add images by selecting an asset catalog, and choosing Editor > Add Assets > Import.
I am pretty sure you will have to put your icons into the project and then recompile. Let us know how it goes.

Remember previous directory when adding existing resource

I have a collection of numerous icons, png files and other graphics data stored on a Icons folder in my secondary hard disk.
When I need a new resource I double click on the resource.resx file and add the new one via 'Add Existing file".
However each time I use this menu, it opens a browse window initially located at C:\Windows\System32. So, each time, I need to go to my Icons folder.
Is there a way to 'teach' Visual Studio how to remember the last folder opened? (Macro? Addin?)
This has annoyed me for quite some time, and just found this via a Google search. I voted it up, but per Microsoft's response on the bug page, it's unlikely it will ever get fixed(it might take all of 5 minutes, after all)...
Anyways, I did find a suitable work-around for my scenario that I wanted to share! Simply use Explorer to navigate to the path with your resources(icons, pngs, etc.) and drag/drop them into the resource list in VS2010. This is actually faster for me, as I have PNG's and an icon for each graphic I add, and this way I can add both with one step, instead of switching between the 'icon' resource section and the 'images' resource section, clicking 'Add Resource'->Existing->find path->select, etc... Hopefully this saves someone considerable time, as it's saved me.

How to quickly add back missing file in xcode

I zipped up my project folder in xcode and moved it to a new computer. When I open up the project it has missing files (file appears red).
How can I add all these files back or re-link them. It is like 20+ files?
Why didnt xcode store the relative path?
Xcode may not update location for some files of your project when you copy/move it from one environment to another. The easiest way I found is something like this:
1-Select your files like this, if they are in different groups, then repeat the flow on each group separately:
2- Show the file inspector:
3- You may notice Xcode has an absolute path for them, which is something not useful, so click on the little icon near Multiple Values. navigate to the folder where your selected files are stored in the finder and click "Choose".
Also, don't forget to change the Location to Relative to Project. Now you will get something like this:
• Select all the missing files that are in one folder in Finder.
• Change Location to Relative to Group ( that's in the File Inspector View -> Utilities -> Show File Inspector )
• Click the choose file button; it is under the Location drop down menu; it is an image that looks like a very small window with a document inside it.
A Choose folder containing the selected references sheet should appear.
• find and select the folder containing the missing files in the finder, then click Choose
(Tested in In xCode v4.3.2)
I normally keep all my files related to the project inside one folder (nested where necessary) and yeah I frequently exchange project files (zip and move) with my peers and nothing like that has ever happened to me.
You can always just drag the files en masse back onto the XCode window, and they'll get re-added. If you have file-system folders that match your Xcode internal organization that makes it even easier.
The UI has changed. In Xcode 10, there's a tiny dot with an arrow in it next to the file path. This does nothing as far as I can tell.
There's an obscure folder icon offset up and to the right of that non-functional arrow... this actually is a button, and it DOES allow you to relink the file.

Resources