Application prefs, the Adobe way



  • The other day I was exporting an InDesign document to PDF, which since a few versions ago, Adobe put into a “background task” so you can continue working with InDesign while it does this. After I while I noticed the progress bar was stuck at 32% — no problem, click the Cancel button. Nothing happens … OK, try some more, same result. Some quick Googling turned up that when this happens, you can’t quit InDesign anymore: if you try to close the document that’s being exported, it’ll say it can’t close it before you cancel the export, but if it doesn’t respond to the button, you’re stuck. Only way out is to force-quit the app (and run a small risk of damage to your document).

    But that’s not the WTF. What I found out when looking for a solution, is that InDesign has a hidden setting that lets you disable exporting in a separate thread, and does it in the foreground like in old versions of the program (CS4 and before). This setting is [url=https://helpx.adobe.com/indesign/kb/pdf-export-background-task-hangs.html]enables as follows[/url]:

    1. Create an empty text file and save it as "DisableAsyncExports.txt”.
    2. Navigate to the location of the InDesign executable, for example:

      Win: C:\Program Files\Adobe\Adobe InDesign CS5\

      Mac: /Applications/Adobe InDesign CS5.5/Adobe InDesign CS5.5.app/Contents/MacOS/

    3. Move the text file from step 1 into this location.


    4. I suppose that does avoid the "Which format do we use for configuration files?" problem.

      Not convinced that the answer "None!" is all that great though. Was expecting something more Enterprisey, like XML wrapped in JSON.



    5. @Gurth said:

      Create an empty text file and save it as "DisableAsyncExports.txt”.

      You're lucky it was an empty file. They could have made you add a header and line as in the old .ini files:

      [DisableAsyncExports]
      DisableAsyncExports=1
      

      That would have added so much configurability.

      And by the way, "Cancel" buttons that do not work are a favorite :wtf: of mine. Why even have it, if you're not going to make it work? Or maybe it does work...30 seconds or a minute after you click it...



    6. The Castle Doctrine does this. Well, not with empty files and not secretly, but each file name in the config directory is the name of a setting, and the content of each file is the value. It's so brilliantly lazy, I wish I'd been the one to do it first.



    7. Well, a filesystem is a key-value storage after all.



    8. I've seen that done by quick and dirty modding tools (like the one that packs loose Skyrim animations into .hkx files.

      That said, Adobe software has been slipping in quality for a solid decade at this point, so it doesn't surprise me one bit.



    9. @CoyneTheDup said:

      You're lucky it was an empty file.

      Another fun thing I found when installing the script to enable/disable background export, that even Adobe itself mentions on the help page I linked to above: if you go to the scripts folder, you’ll find files called ForceDirectory.txt. Opening one, its complete contents turn out to be:

      [code]Short Story:
      This file exists solely to force the source code version control
      system to create this directory/folder.[/code]

      @CoyneTheDup said:

      And by the way, "Cancel" buttons that do not work are a favorite of mine. Why even have it, if you're not going to make it work?

      It normally works, but not (apparently) when the export hangs … which is the one case when you pretty much absolutely need it to work, of course.



    10. @Gurth said:

      when the export hangs

      To be fair, that's not an easy problem to solve. When do you kill the thread? What if that doesn't work?
      if it were me I'd display a cool down, and cancel that if the thread responded to the cancel/etc. action. Else kill the thread after the cool down.



    11. @Gurth said:

      It normally works, but not (apparently) when the export hangs … which is the one case when you pretty much absolutely need it to work, of course.

      I should have been clearer in my statement, because this is exactly my frustration: I've observed nowadays that cancel buttons do work...except when the associated process hangs. Hence my frustration: I very rarely need to cancel a working process.



    12. @Buddy said:

      The Castle Doctrine does this.

      I'm not familiar with this usage (or maybe just didn't get the joke) of "The Castle Doctrine," which is more commonly referring to a principle in self defense law.



    13. It's a videogame.
      Everything is a videogame now.


    14. Grade A Premium Asshole

      0-byte .keep files are an ages-old trick for forcing tar to package up otherwise empty directories.



    15. Right; I've used them in Git too for that purpose.

      BUT YOU DON'T TELL YOUR BUILD SYSTEM TO COPY THE PLACEHOLDER FILES TO THE OUTPUT!



    16. @swayde said:

      When do you kill the thread? What if that doesn't work?

      When the user clicks the Cancel button, I’d say. That’s what it’s there for, regardless of whether — but especially in case when — the thread hangs.

      @bugmenot said:

      0-byte .keep files are an ages-old trick for forcing tar to package up otherwise empty directories.

      Except this one’s not 0 bytes but has some contents to explain why it’s there, and as Blakey says, why do they need to put them on the user’s system? Wouldn’t it be better to have the installer create the necessary directories, for example? Or if you absolutely must include the files for some reason, they could at least hide them so hardly anybody will know they’re there.

      Then again, this is Adobe we’re talking about. I get the impression no two people in that company do things exactly the same way.





    17. Keeping each config value in a separate file is not very common. I'd call it Qmail style and it's a nice way to keep configuration. Syntax is enforced by the filesystem. Very easy to automate. It does feel a bit weird because it's so rare.

      The WTF here is that it's done by a desktop application in seemingly haphazard fashion. If they kept the full config that way, minus the txt extension, it would not be much of a WTF.



    18. @Gurth said:

      When the user clicks the Cancel button, I’d say. That’s what it’s there for, regardless of whether — but especially in case when — the thread hangs.

      When the user presses cancel i'd set a flag in the thread. Then do the cooldown dance. There are usually important things going on in threads. I'd try the approach of less potential damage first - letting the thread clean up after itself - or at least terminate "nicely".



    19. On OS X all the usual settings are stored in a .plist file in the user’s Library folder, on Windows I suppose they go in the registry. Using the same folder as the program’s executable for enabling/disabling this hidden setting is also a WTF, if you ask me: it clutters up the folder, and on OS X, most users won’t know they can get to the folder Adobe’s help page refers them to, or how to do that — won’t even know that /Applications/Adobe InDesign CS5.5/Adobe InDesign CS5.5.app is a folder at all, in fact.



    20. From the user’s point of view, that’s the same as stopping the task when the cancel button is clicked. I for one don’t particularly care how they stop it, I just want it to stop (soon) after I click — especially if the thing appears to be hung.



    21. @swayde said:

      When the user presses cancel i'd set a flag in the thread. Then do the cooldown dance. There are usually important things going on in threads. I'd try the approach of less potential damage first - letting the thread clean up after itself - or at least terminate "nicely" - in whenever decade it feels like getting around to it..

      FTFY


    22. Impossible Mission Players - A

      Well the Cancel button does work: It sends a Cancel message to a process that is frozen solid. It's not the button's fault that the process froze!



    23. @Tsaukpaetra said:

      Well the Cancel button does work: It sends a Cancel message to a process that is frozen solid. It's not the button's fault that the process froze!

      I can be pedantic, too. When I click the "Cancel" button, I want the process it is supposed to stop, to actually stop. It is insufficient for the "Cancel" button to depress and then return to normal.


    24. sockdevs

      Discocancel


    25. Impossible Mission Players - A

      We know what you want to have happen, it's just that it's not spec'd for it to happen in that manner. ;)
      Remember when the Power button meant "I want the thing to turn off"? Nowadays, it means "Um, I would like for the thing to turn off, but if you're in the middle of something, um, well, finish that first and maybe, um, since you're going to be off, maybe now is a good time to force some updates to install? Um, but, uh, maybe you wanted to sleep instead? That might be nice. Maybe you want me to tell you what things are stopping me from turning off? You could change your mind then!"



    26. Device :hankey: does not obey - makes me :rage: :knife: :hammer: :fa_trash_o: :fa_bolt: :fire:



    27. However, PCs provide a "push and hold" override for their Power button to allow you to force a hung machine off. The problem with providing an override-type functionality in Cancel buttons is that forcibly terminating a thread can leave resources (such as locks) in states that render the process dysfunctional/inoperable.

      Interestingly enough, this isn't usually a problem in single-threaded apps, or in a multi-process model... ;)


    28. :belt_onion:

      As in Discontinue?



    29. @Gurth said:

      in a .plist file

      This may actually hint at the source of this WTF. Faced with the prospect of manual modifications to plist files, the devs might just have preferred this simple file-flag which is easy to set and clear.

      @Gurth said:

      Using the same folder as the program’s executable for enabling/disabling this hidden setting is also a WTF

      Haha, yes it is. Unless you were to accept the reasoning that such settings are best forgotten about after an update.

      I am shocked to conclude that this WTF may have resulted fom choices which are dubious but not devoid of justification.


    30. Grade A Premium Asshole

      @blakeyrat said:

      BUT YOU DON'T TELL YOUR BUILD SYSTEM TO COPY THE PLACEHOLDER FILES TO THE OUTPUT!

      If your packaging and deployment system uses tar or a vaguely tar-alike, you don't have a choice in the matter.

      @Gurth said:

      Except this one’s not 0 bytes but has some contents to explain why it’s there...

      I chalk that up to the lower average competency of Windows users.

      @Gurth said:

      Wouldn’t it be better to have the installer create the necessary directories, for example?

      Yes.



    31. @gleemonk said:

      Faced with the prospect of manual modifications to plist files, the devs might just have preferred this simple file-flag which is easy to set and clear.

      As opposed to, say,

      [code]defaults write com.adobe.indesign DisableAsyncExports -bool true[/code]

      @gleemonk said:

      Unless you were to accept the reasoning that such settings are best forgotten about after an update.

      It does that anyway with all your preferences if you update any Adobe product from one major version to another (like CS5.5 to CS6 — not sure about CC because I don’t like subscriptions for software). You have to go through the prefs and set things the way you want them once more, arrange your palettes and tool windows and things to your liking, redefine your custom keyboard shortcuts, and so on. It gives every impression of each version using its own prefs files and not even bothering to import existing ones.

      @gleemonk said:

      choices which are dubious but not devoid of justification.

      That goes for nearly any decision. It doesn’t make it any better, though :)


    32. Discourse touched me in a no-no place

      @bugmenot said:

      If your packaging and deployment system uses tar or a vaguely tar-alike, you don't have a choice in the matter.

      Then you should probably have your program create directories if they don't exist, instead of using placeholder files.



    33. @bugmenot said:

      If your packaging and deployment system uses tar or a vaguely tar-alike, you don't have a choice in the matter.

      Then you copy it into a staging area first. And only stage what is actually needed.



    34. @Gurth said:

      As opposed to, say,

      defaults write com.adobe.indesign DisableAsyncExports -bool true</blockquote>
      

      Have users resort to a teletype interface? Never! That would be bad UI design.

      @Gurth said:

      It gives every impression of each version using its own prefs files and not even bothering to import existing ones.

      So the location of the file was chosen with respect to consistency in config-trashing.

      @Gurth said:

      That goes for nearly any decision. It doesn’t make it any better, though

      We must accept that their hand was forced by the adversity of the situation. What may seem like a WTF to outside observers is often a considerate response to intricate technological issues.



    35. @tarunik said:

      However, PCs provide a "push and hold" override for their Power button to allow you to force a hung machine off.

      Not completely. Every now and then IE manages to lock my Win7 work machine up so badly that this has no effect (and yes, I've tested to make sure that it does have the expected effect at other times). The only recourse is to pull the power cord out.



    36. @Scarlet_Manuka said:

      Every now and then IE manages to lock my Win7 work machine up so badly that this has no effect (and yes, I've tested to make sure that it does have the expected effect at other times).

      Iiiinteresting. Didn't know IE has the ability to physically prevent an off switch from functioning, because the 4-second-override is fully baked into hardware as per ACPI.



    37. Unless the ACPI state machine is busted. Which could happen if it's a cheap PC that relies on the PIC timer for timing and that's what's getting horked.



    38. @TwelveBaud said:

      a cheap PC that relies on the PIC timer for timing

      Well if a 555 is too expensive for you, I guess...


    39. Discourse touched me in a no-no place

      @Maciejasjmj said:

      Well if a 555 is too expensive for you, I guess...

      It seems like nothing is cheap enough for the bean counters running everything these days...


    40. Discourse touched me in a no-no place

      @lolwhat said:

      It seems like nothing is cheap enough for the bean counters running everything these days...

      How else can we afford to have bean counters?



    41. 555s are pretty expensive when you've already got the MCU that's supposed to respond to said timeout.
      I would not be surprised to find UEFI/BIOS implementations that can be crashed by the OS.



    42. @lightsoff said:

      555s are pretty expensive when you've already got the MCU that's supposed to respond to said timeout.

      ITYM "when you don't have". But even then, all the 555 has to do is to trip the power - you don't need a single line of a program for that.

      And I'm fairly certain that even when I botched my UEFI upgrade enough to actually have to hook up a JTAG because nothing would work (thank you, MSI updater, now go die in a fire), the hold-to-turn-off functionality worked fine. It should live totally beyond UEFI/BIOS.



    43. @Maciejasjmj said:

      Iiiinteresting. Didn't know IE has the ability to physically prevent an off switch from functioning, because the 4-second-override is fully baked into hardware as per ACPI.

      Trust me, I was extremely surprised the first time holding the power button in for four seconds (and then 10 seconds and then 30 seconds, "just in case") had no effect.

      Now it's happened often enough that I'm no longer surprised, just irritated and resigned. And often enough for me to be pretty confident in pinning the blame on IE, when certain specific (usually OK) actions are performed. (Most likely actually some dodgy add-on. But it doesn't happen frequently enough to make it easy to narrow down.)

      As for the cheapness or otherwise of the hardware... it is a Dell, so there's that.


    44. Discourse touched me in a no-no place

      @Scarlet_Manuka said:

      Trust me, I was extremely surprised the first time holding the power button in for four seconds (and then 10 seconds and then 30 seconds, "just in case") had no effect.

      Yank the power, including the battery (if you're on a laptop). Anything that insists on that sort of :shit: gets the “no electricity for you” super-override.



    45. This is what I did with a fuse-file system I wrote to make config changes while it is mounted.
      Now that I think about it, it doesn't seem much different than /proc.



    46. Everything is a 📁.



    47. @dkf said:

      Yank the power

      Yes, that would be why I said
      @Scarlet_Manuka said:
      The only recourse is to pull the power cord out

      in my earlier post.


    48. Discourse touched me in a no-no place

      Reading all preceding posts is a barrier to high post counts.



    49. It was a pretty fun game. Basically you needed to build some traps to protect your vault, them go out and try to rob other people's vaults. The way it was set up, you couldn't leave your house to rob anyone else unless you could get from your own door to your vault without dying (permanently!) to your own traps. Plus the robbers get to use items to disarm traps but you couldn't use any during the self tests. I'm not sure if this synopsis is doing it justice, but it really was a great game. You could build an awesome house, spend days or weeks getting it just like you wanted, watch hundreds of people trying to get through it and fail, then make one stupid move and be back to square one like “I hate this game I'm never coming back” but then find yourself unable to sleep thinking of all the things you're gonna do better next time. If it weren't for its flaws, it'd pretty much be perfect.

      The main problem was that it was an online game, but it just didn't end up with enough players. The deeper problem was that it was hard to balance. Early on (during the beta) you could build a house with walls nine layers deep (robbers could only carry eight tools) covering a twelve bit combination lock and have something that was impractical to crack, with no risk to yourself. Later, he changed it to provide a way around such cheap tactics, but that meant that it became incredibly hard to protect your stuff, unless you had a lot of money to build something good with, which I never did, because the changes that were made also meant that it was a lot harder to get big payouts.


    50. Grade A Premium Asshole

      The thing that really miffed me about The Castle Doctrine were the houses that had a trap door adjacent to the entrance square triggered by a guard dog that moved immediately after you took your first step. Totally bullshit.




    Log in to reply
     

    Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.