topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 2:35 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: -save option not saving, no error  (Read 4715 times)

jcollum

  • Participant
  • Joined in 2011
  • *
  • Posts: 17
    • View Profile
    • Donate to Member
-save option not saving, no error
« on: August 15, 2011, 11:07 AM »
I'm using this command line to save to a file:

   minicap -save "c:\temp\screenshots\capture_$nicename$_$Y$m$d_$H$M" -sleep 2 -capturescreen -closeapp -exit

Seems straightforward. But when I look in C:\temp\screenshots there is no file with the name "capture...". What's wrong with the command line? I've tried running the cmd window in Admin and normal mode.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: -save option not saving, no error
« Reply #1 on: August 15, 2011, 11:13 AM »
try this, add -prompsave to your commandline and see if it pops up a dialog box showing you the suggest save location and filename, that might give you a clue.

it may be that $nicename$ has some illegal characters in it that are not being escaped as they should be.

worstje

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 588
  • The Gent with the White Hat
    • View Profile
    • Donate to Member
Re: -save option not saving, no error
« Reply #2 on: August 15, 2011, 11:15 AM »
I don't use SC... but I have to ask because my curiousity is killing me :P. Is it -prompsave or -promptsave? One of them is rather misspelled.. :)

jcollum

  • Participant
  • Joined in 2011
  • *
  • Posts: 17
    • View Profile
    • Donate to Member
Re: -save option not saving, no error
« Reply #3 on: August 15, 2011, 11:29 AM »
Yeah it's -promptsave. That did help, but it's still not working the way I want. Here's the more correct version:

     minicap -save "c:\temp\screenshots\capture_$customdate$_$appname$" -customdate "$Y$m$d_$H$M$S" -sleep 2 -capturescreen -closeapp -exit

Two issues:

First, it's not saving files. If I use -promptsave then it asks me where to save and I just hit OK on that dialog and it works fine. But without the promptsave it won't do anything.
Second, there is a dot after the $customdate$ token, so it does "capture_20110815_092802_cmd..gif".

I'd expect the app to return an error if the filename isn't a valid filename, instead it just fails silently. Silent failures are bad usability.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: -save option not saving, no error
« Reply #4 on: August 15, 2011, 11:50 AM »
Silent failures are bad usability

i agree, i will look at the save code.  but you say that it works if you use -promptsave but not if you don't.  that's odd.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: -save option not saving, no error
« Reply #5 on: August 15, 2011, 12:18 PM »
ok so i think the reason its failing is because you are not specifying an image file extension.

so you should have for example:
 minicap -save "c:\temp\screenshots\capture_$customdate$_$appname$.png" -customdate "$Y$m$d_$H$M$S" -sleep 2 -capturescreen -closeapp -exit

i am adding error reporting now to report failure to save.

jcollum

  • Participant
  • Joined in 2011
  • *
  • Posts: 17
    • View Profile
    • Donate to Member
Re: -save option not saving, no error
« Reply #6 on: August 15, 2011, 12:43 PM »
That fixed it! Thanks for the assist.