Jump to content
Ketarin forum

Search the Community

Showing results for 'rename variable'.

  • Search By Author

Content Type


Forums

  • Discussion
    • General discussion
    • Feature requests
    • Bugs
  • Resources
    • Tips and Tutorials
    • Templates

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Database GUID

  1. I try to be consistent with variable names for multiple reasons. Sometimes, I would like to rename a variable (in the left side list of Edit Variables window) but there is no way to do it, I have to delete the variable and fully recreate it with the new name. A workaround is to export the app, edit the XML, then reimport it. But either solution is too much work for a simple rename! Thanks
  2. Wondering if this is possible? What I tried : The "$app.variables" object has the following method : void Add(string key, Ketarin.UrlVariable value) This tells me I need to create an instance of "Ketarin.UrlVariable": I try this : New-Object -TypeName Ketarin.UrlVariable Error message results : "A constructor was not found .." So I thought maybe the constructor requires some parameters: I tried to find them : ([Type]"Ketarin.UrlVariable").GetConstructors() | ForEach {$_.GetParameters()} | Select * No output in log. So does this mean we don't have access to the "Ketarin" namespace? Thx
  3. Hi. Why, when I pour Katarin on an external hard drive and want to use it on another computer, I have to rename the external hard drive and make it look like a computer hard drive that contained katarin. Because otherwise some programs will not be installed. Is there a solution to that?
  4. can we execute 2 or more download whith content of different variable in this example i need download 1 book and its image do you have an idee for that ?
  5. The attached ApplicationJob is my first try to use the ifempty-variable-function, directly (see 'version' variable) and in-directly (see 'url' variable) but neither seem to work. I keep getting the "The URL you entered is empty and cannot be loaded." error message. Any help would be appreciated. Thnx Using Ketarin 1.8.8b4. Sordum.DeskEdit.xml
  6. Apple has abandoned any pretense of including actual version numbers on their site in non-security updates (and - possibly for the first time in history - they actually released an iTunes update that isn't a security update!). This leaves me with no valid external source for the current version number for iTunes. I can get it from the downloaded file after download with FileVer or FSO or from the FileVersion PS property (`[System.Diagnostics.FileVersionInfo]::GetVersionInfo("{file}").FileVersion`). However, I need to cleanly populate this within the {version} variable for my own purposes. I don't mind re-downloading the update every time I check for updates (if I must) but I'd prefer to only download if the file information changes. I've removed the 'check against' variable and Ketarin's native change detection appears to be working perfectly. I'm now using the following application XML to make it work and parse the version correctly. One caveat: since the version is parsed before the file is completely updated it MIGHT result in the wrong version number being assigned in the version column at first, so I added a script to my post-update script to re-trigger the psversion check so it's properly represented in the column as well as properly pushed in the rest of my after-update script. Here's the xml: <?xml version='1.0' encoding='utf-8'?> <Jobs> <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Category>Media</Category> <WebsiteUrl>https://www.apple.com/itunes/</WebsiteUrl> <UserAgent>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Media Center PC 5.0; SLCC1; Tablet PC 2.0; .NET4.0C)</UserAgent> <UserNotes /> <IgnoreFileInformation>false</IgnoreFileInformation> <DownloadBeta>Avoid</DownloadBeta> <DownloadDate xsi:nil="true" /> <CheckForUpdatesOnly>false</CheckForUpdatesOnly> <VariableChangeIndicator /> <HashVariable /> <HashType>None</HashType> <CanBeShared>true</CanBeShared> <ShareApplication>false</ShareApplication> <ExclusiveDownload>true</ExclusiveDownload> <HttpReferer>https://www.apple.com/itunes/download</HttpReferer> <SetupInstructions /> <Variables> <item> <key> <string>version</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <TextualContent>{psversion:ps}</TextualContent> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>sdownload</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <TextualContent>https://www.apple.com/itunes/download/win64</TextualContent> <Name>sdownload</Name> </UrlVariable> </value> </item> <item> <key> <string>psversion</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>[System.Diagnostics.FileVersionInfo]::GetVersionInfo("{file}").FileVersion</TextualContent> <Name>psversion</Name> </UrlVariable> </value> </item> </Variables> <ExecuteCommand /> <ExecutePreCommand /> <ExecuteCommandType>Batch</ExecuteCommandType> <ExecutePreCommandType>Batch</ExecutePreCommandType> <SourceType>FixedUrl</SourceType> <DeletePreviousFile>true</DeletePreviousFile> <Enabled>true</Enabled> <TargetPath>..\{category}\{appname:regexreplace:([\s\t\r\n\-\&amp;]+):_}-{version}.{url:ext}</TargetPath> <FixedDownloadUrl>{sdownload}</FixedDownloadUrl> <Name>iTunes (x64)</Name> </ApplicationJob> </Jobs>
  7. I'm trying the following: define a global variable, e.g. "7zip" create a PowerShell "before updating" global command: "$7zip = $GlobalVars.'7zip'.CachedContent" then try using this in a PowerShell command "after downloading": $7zip x c:\temp\test.zip This is not working, it seems that $7zip is not defined when "after downloading" script is executed. Any ideas how to solve that? Putting "$7zip = $GlobalVars.'7zip'.CachedContent" within the "after download" section works but then I'd have to put it in every application which I want to avoid...
  8. hello can you see me an exemple for use variable "if empty" in ketarin! i need go in another URL if result is empty thx for your help
  9. Hi! What I want to do is setup a random variable once before the application update check (not the download) starts and then have this variable been used during updating and downloading several times without having its original value being changed again. It should change before the next update check, though. Is this possible? Currently the random variable gets updated everytime its used, causing different results in the parts of the update process. That's bad.
  10. When i add a variable to an application, which is part of the download URL (for example https://download-installer.cdn.mozilla.net/pub/firefox/releases/{version}/win32/en-US/Firefox Setup {version}.exe) or the filename (for example d:\Firefox {version}.exe), and the variable is read from a local file, then canceling a file download (update or force download) will result in an unhandled exception error: I get the same error with Ketarin 1.8.10.15 and 1.8.11 Beta. These are the steps to recreate this error (using Firefox as an example): Create a text file (c:\firefoxversion.txt) and write a version number into it (68.0). Create a new application in Ketarin (Firefox), and add a version variable to it. Change the type to Content from URL (Regular Expression), add the path to the text file into Contents from URL (c:\firefoxversion.txt), and add [\d\.]+ as the regular expression. Add the download URL: https://download-installer.cdn.mozilla.net/pub/firefox/releases/{version}/win32/en-US/Firefox Setup {version}.exe Add a path to Save in folder (c:\). Update (or force download) this application. Cancel during the download. I uploaded firefoxversion.txt and firefox.xml. To test this, import firefox.xml into Ketarin and copy firefoxversion.txt to c:\. firefoxversion.txt firefox.xml
  11. I just dropped a hint in another thread, but thought I'd come here and make it official after all :-) It would be very handy to have a "copy variable" function. I'm thinking of variables that are currently defined within the download entry you're working on, but I suppose it could extend to any variables defined in any Ketarin download entry. It's not that big of a deal to define two variables by hand. But if both use the same source URL and/or both have similar scrape instructions, it would be nice to define one and get it working, then copy it to a new name and alter as needed. Similarly, a rename variable function would be handy, though if we had "copy variable" a rename could be handled as a two-step process (copy to new name, delete old name). While I'm here :-) I've sometimes wanted a "disable variable" function. I'd like to leave the variable in the Ketarin entry, but mark it such that Ketarin doesn't process it. Useful if I'm working on an alternate scrape, for example, but don't want Ketarin to spend any cycles on it except when I'm working on it. Probably not a big deal if we don't get it, but hey it can't hurt to ask :-) Thanks and regards, --appyface
  12. Ketarin variables and their equivalents: The variables are placed into four groups according to essential character. Ketarin Powershell -------- ------------ [Native] {filesize} $app.LastFileSize {category} $app.Category {appname} $app.Name or $app {appguid} $app.Guid {file} [$file =] $app.CurrentLocation [Derived : refer to {file}] {url:ext} (Get-Item $file).Extension {url:basefile} (Get-Item $file).Basename (result: ccleaner) {root} split-path $file -Qualifier (result: C:) (PWD).drive.root (result: C:\) Job/App dir (Get-Item $file).DirectoryName (no trailing \) File.Ext (Get-Item $file).Name {startuppath} PWD (assumes no prior CD) (no trailing \) [Job specific user defined variables] {"myvar"} $app.variables."myvar".CachedContent $app.variables."myvar".TextualContent [User-defined global variables] {"myglobalvar"} $globalvars."myglobalvar".CachedContent How to make their use more convenient ? The native Ketarin syntax is very convenient. To assist in making the Powershell equivalents more so, you may do the following. At the beginning of each cammand input insert a predefined, saved snippet that looks something like this: $file = $app.CurrentLocation $fdir = (Get-Item $file).DirectoryName $fnm = (Get-Item $file).Basename $fext = (Get-Item $file).Extension $fnmext = (Get-Item $file).Name $kroot = PWD How do you know this without official documentation ? From within a Ketarin command input, set to "Powershell script", and type: $app | Select-Object * | Out-File c:\app.txt -width 400 $globalvars | Select-Object * | Out-File c:\globalvars.txt -width 400 Repeat whenever you encounter a property which refers to a sub-object, ie. {.....}. Also, don't forget "Get-Member" and "Get-Member -Force".
  13. Hello, it would be nice to have few option for variable list like: - resize or autosize column with variables - auto-sort or at least manual sort of variables Thank you in advance for considering this. UserEcho: https://ketarin.userecho.com/communities/1/topics/76-variable-list-options
  14. How the Custom column should work with Textual variable? I used to be able to see value of a Textual variable under Custom Column added by a script, but only when I added the value also to CachedContent property. I was using sqlite for this. The value updated only after re-start, but it was working ok otherwise. Recently the whole Column showing my custom variable: "Current Version" remained blank and I thought this was broken by an update, but now I tried various old versions and the value is still not shown. I found an old jobs.db and the previous functionality returned, but the curious thing is, with the recent jobs.db, which wasn't showing my "Current Version", if I blank the TextualContent and keep only CachedContent, it will show it under the Column. I am doing this using PS: $app.variables.$Name.TextualContent = $null # "" works too I become quite certain that either I am doing something wrong, or this feature doesn't work for Textual variables. CachedContent is shown in Column, but TextualContent in UI > App > Edit > Variables > Textual content Shouldn't TextualContent be shown under Column for Textual variable? Could they maybe be interlocked for Textual variable type, to keep existing scripts functional?
  15. Forgot I ever made this topic. I eventually just wrote a powershell script that you just pass parameters to and away it goes. Copy and paste the below code into a blank txt file, save it as whateveryouwant.ps1 To use just type in the command line yourfilename.ps1 themovieyouwantrenamed You can even just pass an entire folder to it and it will iterate all of them. Still uses mediainfo to determine resolution Get-WmiObject Win32_LogicalDisk | ? {$_.Size -ne $null} | % {if (Test-Path ($_.DeviceID + "\Autorun.bat")) {$Drive = $_.DeviceID}} $MI = gci -r "$Drive\Programs" mediainfo.exe | % {$_.FullName} $Videos = gci "$args*" -Include *.nfo,*.mkv,*.mp4,*.avi,*.m2ts,*.wmv -Exclude ``[* | % { write-host $_.basename " " $Name = $_.basename -match '(.*)\d\d\d\d|(.*)' | %{$Matches[1]} | %{$_ -replace "[^\w\d]"," "} | %{($_).TrimEnd()} $Year = $_.basename -match '\d\d\d\d' | %{$Matches[0]} $SearchName = $Name + " " + "($Year)" $search = 'http://www.imdb.com/find?s=all&q=' + "$SearchName" $titlepage = (New-Object System.Net.WebClient).DownloadString($search) -match "/title/.*?/" | %{$Matches[0]} $scrape = (New-Object System.Net.WebClient).DownloadString('http://www.imdb.com' + "$titlepage") | Out-File "$($_.Directory)\$($_.basename).txt" $imdbpage = gc "$($_.Directory)\$($_.basename).txt" New-Object PSObject -Property @{ Dirn = $_.Directory Baname = $_.basename FName = $_.FullName Ext = $_.extension Resolution = &$MI "--Inform=Video;%Width%" $_.FullName | % { if (900 -lt $_ -and 1400 -gt $_) {echo 720p} else { if (1400 -lt $_) {echo 1080p} else { if (900 -gt $_) {echo SD $_} } } } IMDBName = "$imdbpage" -match "<title>(.*?)</" | %{$Matches[1]} | %{$_ -replace "[<>:`"\\/\|\?\*.]",""} | %{$_ -replace "'","'"} | %{$_ -replace "&","&"} | %{$_ -replace """,""} | %{$_ -replace "x22;",""} | %{$_ -replace " - IMDb",""} | %{$_ -replace " \(.*?\)",""} IMDBYear = "$imdbpage" -match "\((\d\d\d\d)\)" | %{$Matches[1]} IMDBBlurb = "$imdbpage" -match "<p>([\w\d].*?)</p>" | %{$Matches[1]} IMDBRating = "$imdbpage" -match "(\d\.\d)/10" | %{$Matches[1]} IMDBDirector = "$imdbpage" -match "Director:(.*?)</div>" | %{$Matches[1]} | %{$_ -replace "<.*?>",""} | %{$_ -replace "\s[\s]+"," "} IMDBWriters = "$imdbpage" -match "Writers:(.*?)</div>" | %{$Matches[1]} | %{$_ -replace ""","`""} | %{$_ -replace "<.*?>",""} | %{$_ -replace "\s[\s]+"," "} IMDBStars = "$imdbpage" -match "Stars:(.*?)</div>" | %{$Matches[1]} | %{$_ -replace "<.*?>",""} | %{$_ -replace "\s[\s]+"," "} IMDBSynopsis = "$imdbpage" -match ".*(<p>([\w\d].*?)<)" | %{$Matches[2]} | %{$_ -replace "'","'"} } del "$($_.Directory)\$($_.basename).txt" } $Videos | %{ #Just a piece of code to output all the relevant IMDB information to an accompanying .nfo file #Decided not to implement but keeping for shits and giggles #('Movie Title: ' + $_.IMDBName + "`n" + , #'Release Year: ' + $_.IMDBYear + "`n" + , #'Blurb: ' + $_.IMDBBlurb + "`n" + , #'Director:' + $_.IMDBDirector + "`n" + , #'Writers:' + $_.IMDBWriters + "`n" + , #'Stars:' + $_.IMDBStars + "`n" + , #'Synopsis: ' + $_.IMDBSynopsis + "`n" + , #'IMDB Rating: ' + $_.IMDBRating + '/10') | Out-File "$($_.Dirn)\$($_.Baname).nfo" # #Rename-Item "$($_.Dirn)\$($_.Baname).nfo" "`[$($_.Resolution)`] $($_.IMDBName) `($($_.IMDBYear)`).nfo" if ($_.IMDBName -ne $null) {Rename-Item $_.FName "`[$($_.Resolution)`] $($_.IMDBName) `($($_.IMDBYear)`)$($_.Ext)" -ErrorAction SilentlyContinue} }
  16. I don't believe there is any way to get an Environment Variable into Ketarin. I would really like to be able to get access to the Computer Name that I'm on. I'd primarily want it so I can customize the download directory so that it would be something like H:\Ketarin\Downloads\Computer_Name\Category_Name Anybody have any workarounds you can suggest? Ideally, a future version of Ketarin would either allow access to all Environment Variables or there would be a way to create a Ketarin Global Variable through the commandline such as h:\ketarin /PARM="COMPUTERNAME:"Starfish" so that the Ketarin Global variable {COMPUTERNAME} would be "Starfish"
  17. I'm seeing strange UA behavior in Ketarin 1.8.7. I haven't tested this thoroughly, but in my experiments I'm seeing a couple bugs. First, I'd love for the global default user-agent to be alterable. Not just the UA for specific apps, but for the entire installation all at once. Now for the bugs: I assume that the user-agent will be included with all requests, but that's not actually the case. At least during development in the Variables editor, URL requests are sent with an empty UA. Since this is a sure-fire sign of unwelcome traffic, some servers (including my own) block the request with a 403 forbidden. Including the UA with these requests is important. Now, the default UA is *not* included in those instances. But if you set a custom UA in the Advanced settings tab that UA will be used immediately on Variables URL requests. The workaround is to manually assign a custom UA for each app that has problems due to UA filtering. Expected behavior is to use the global UA for all requests, especially those from the Variables feature, except where it's superseded by the app-specific "User agent" option.
  18. Like the title says.Let's assume i have commandline that gets value from a text file (let's assume the text file only contains "1.0") and then sets temporary variable based on that: set /p myvar= < %temp%\myvar.txt So i have %myvar% and when i enter it it translates into 1.0 but now i need to insert it into {version} variable in Ketarin. Is it possible? I tried {version} < %temp%\myvar.txt and {version} < %myvar% But no luck. I assume the {version} variable itself has to be textual.
  19. Hi all, everyone who is interested in the following feature, please comment on my proposed implementation: https://ketarin.userecho.com/topics/17-emit-error-if-empty-variable-has-been-generated/ Also don't forget to re-allocate your votes of closed ideas Best regards, Florian
  20. Should this work? Currently, it does not appear to work. Define Global Variable UserAgent-64 as Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 Replace that full string in the application Advanced setting -> User Agent with {UserAgent-64}. "Update" works fine with the original string as User Agent. "Update" fails with the global variable {UserAgent-64} as User Agent: "Bad Request". --> This failure also occurs as well when checking the "variable" settings of this app (Java manual download, which by default does not reveal the 64-bit BundleID when defining app variables) Any help?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.