I got mine. Thanks Thanks Thanks. Very cool.Jan Rysavy wrote:All registration keys are out. Please contact me if you didn't receive it (check also your spam folder).
Automation Script Contest: 3 Free Salamander Licenses
Re: Automation Script Contest: 3 Free Salamander Licenses
http://www.dev0.de / http://murphys.me
Re: Automation Script Contest: 3 Free Salamander Licenses
Thanks!!Jan Rysavy wrote:All registration keys are out. Please contact me if you didn't receive it (check also your spam folder).
Kind regards, KNUT
_____________________________________________
Satisfied Servant Salamander User from Version 1.5 till now
_____________________________________________
Satisfied Servant Salamander User from Version 1.5 till now
Re: Automation Script Contest: 3 Free Salamander Licenses
I got mine too. Thanks Jan!
Re: Automation Script Contest: 3 Free Salamander Licenses
These scripts are really great
Is it planned to have a database on the official website ?
Is it planned to have a database on the official website ?
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
Re: Automation Script Contest: 3 Free Salamander Licenses
It would be nice, but we would need maintainer.
Re: Automation Script Contest: 3 Free Salamander Licenses
What's about a simple Wiki?Jan Rysavy wrote:It would be nice, but we would need maintainer.
Kind regards, KNUT
_____________________________________________
Satisfied Servant Salamander User from Version 1.5 till now
_____________________________________________
Satisfied Servant Salamander User from Version 1.5 till now
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
Re: Automation Script Contest: 3 Free Salamander Licenses
Such list could be maintained on this forum, there is option to edit own posts. See for example this post: http://forum.altap.cz/viewtopic.php?f=23&t=3959#p19820
Wiki could be next step.
Wiki could be next step.
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
Re: Automation Script Contest: 3 Free Salamander Licenses
New script idea: Recursive File/Directory list.
Could be based on existing C:\Program Files (x86)\Altap Salamander\plugins\automation\scripts\Count Lines.js (for example).
Could be based on existing C:\Program Files (x86)\Altap Salamander\plugins\automation\scripts\Count Lines.js (for example).
NEW SCRIPT: rename2filedate.vbs
Append the filedate (NOT the current date!) to the selected file.
Code: Select all
' rename2date.vbs
' Rename the current/selected files and directories by adding the date
' 25.03.2010 th.
'
Dim Items
Dim Fso, Item, OverwriteAnswer, Overwrite
Set Fso = CreateObject("Scripting.FileSystemObject")
OverwriteAnswer = 0
'--- Identify the item(s) to rename
If Salamander.SourcePanel.SelectedItems.Count = 0 Then
If Salamander.SourcePanel.FocusedItem.Name <> ".." then
RenameItem Salamander.SourcePanel.FocusedItem, False
Else
Salamander.MsgBox "Please select or focus an item first.",0,"Rename"
Salamander.AbortScript()
End If
Else
Set Items = Salamander.SourcePanel.SelectedItems
End If
If VarType(Items) <> 0 Then ' vbEmpty
'--- Set up progress dialog
Salamander.ProgressDialog.Style = 1
Salamander.ProgressDialog.Maximum = Items.Count
Salamander.ProgressDialog.Show
Salamander.ProgressDialog.AddText "Renaming ..."
' Iterate through the item collection rename each item
For Each Item In Items
RenameItem Item, True
If Salamander.ProgressDialog.IsCancelled then Salamander.AbortScript() ' Canceled
Next
End If
Sub RenameItem(Item, ShowProgress)
If Item.Name <> ".." Then
IsDirectory = (Item.Attributes And 16) <> 0
OldFilename = Salamander.SourcePanel.Path & "\" & Item.Name
'Salamander.MsgBox Item.DateLastModified
SplitFilenameAndExtension Item.Name, OldName, OldExtension
' Build the new name for the item - this has to be adapted!
YMD = Item.DateLastModified
YMD1 = InStr (1, YMD, ".")
YMD2 = InStr (YMD1+1, YMD, ".")
YMDMON = "0" & mid(YMD,YMD1+1,YMD2-YMD1-1)
YMDDAY = "0" & mid(YMD,1,YMD1-1)
'Salamander.MsgBox YMD & "#" & YMD1 & "#" & YMD2 & "#" & YMDDAY & "#" & YMDMON
NewFilename = Salamander.SourcePanel.Path & "\" & _
OldName & "_" & mid(YMD,YMD2+1,4) & "-" & Right(YMDMON,2) & "-" & Right(YMDDAY,2)
If OldExtension <> "" Then NewFilename = NewFilename & "." & OldExtension
If ShowProgress Then
Salamander.ProgressDialog.Step(1)
Salamander.ProgressDialog.AddText vbCrLf & OldFilename & " --> " & NewFilename
End If
Overwrite = True
If Fso.FileExists(NewFilename) Then
'neither "skip all" nor "all" has been pressed before, ask
If OverwriteAnswer < 17 then _
OverwriteAnswer = Salamander.OverwriteDialog(NewFilename, OldFilename, 4)
Select Case OverwriteAnswer
Case 2
Salamander.AbortScript() ' Cancel
Case 7, 16, 17
Overwrite = False
Case Else ' Overwrite, target has to be deleted
If IsDirectory then
Fso.DeleteFolder NewFilename
Else
Fso.DeleteFile NewFilename
End If
End Select
End If
If Overwrite then
If IsDirectory Then
Fso.MoveFolder OldFilename, NewFilename
Else
Fso.MoveFile OldFilename, NewFilename
End If
End If
End If
End Sub
Sub SplitFilenameAndExtension(FileName, Name, Extension)
Dim n
For n = Len(FileName) to 1 step -1
If Mid(FileName, n, 1) = "." Then Exit For
Next
if n < 1 then
Name = FileName
Extension = ""
Else
Name = Left(FileName, n - 1)
Extension = Mid(FileName, n + 1)
End If
End Sub
- Attachments
-
- rename2filedate.txt
- (3.91 KiB) Downloaded 785 times
Kind regards, KNUT
_____________________________________________
Satisfied Servant Salamander User from Version 1.5 till now
_____________________________________________
Satisfied Servant Salamander User from Version 1.5 till now
NEW SCRIPT: renameorcopy2filedate.vbs
Another dirty hack: rename OR copy 2 filedate...
Code: Select all
' rename2date.vbs
' Rename the current/selected files and directories by adding the date
' 25.03.2010 th.
' 31.08.2010 KNUT
Dim Items
Dim Fso, Item, OverwriteAnswer, Overwrite
Set Fso = CreateObject("Scripting.FileSystemObject")
OverwriteAnswer = 0
'Copy or rename
Set Form1 = Salamander.Forms.Form("Only Rename or Copy to an new file?")
Form1.b1 = Salamander.Forms.Button("&Copy", 3)
Form1.b2 = Salamander.Forms.Button("&Rename", 4)
Result = Form1.Execute
Select Case Result
Case 3
DOCOPY = True
Case 4
DOCOPY = False
End Select
If Path <> "" Then DOCOPY = False
'--- Identify the item(s) to rename
If Salamander.SourcePanel.SelectedItems.Count = 0 Then
If Salamander.SourcePanel.FocusedItem.Name <> ".." then
RenameItem Salamander.SourcePanel.FocusedItem, False
Else
Salamander.MsgBox "Please select or focus an item first.",0,"Rename"
Salamander.AbortScript()
End If
Else
Set Items = Salamander.SourcePanel.SelectedItems
End If
If VarType(Items) <> 0 Then ' vbEmpty
'--- Set up progress dialog
Salamander.ProgressDialog.Style = 1
Salamander.ProgressDialog.Maximum = Items.Count
Salamander.ProgressDialog.Show
Salamander.ProgressDialog.AddText "Renaming ..."
' Iterate through the item collection rename each item
For Each Item In Items
RenameItem Item, True
If Salamander.ProgressDialog.IsCancelled then Salamander.AbortScript() ' Canceled
Next
End If
Sub RenameItem(Item, ShowProgress)
If Item.Name <> ".." Then
IsDirectory = (Item.Attributes And 16) <> 0
OldFilename = Salamander.SourcePanel.Path & "\" & Item.Name
'Salamander.MsgBox Item.DateLastModified
SplitFilenameAndExtension Item.Name, OldName, OldExtension
' Build the new name for the item - this has to be adapted!
YMD = Item.DateLastModified
YMD1 = InStr (1, YMD, ".")
YMD2 = InStr (YMD1+1, YMD, ".")
YMDMON = "0" & mid(YMD,YMD1+1,YMD2-YMD1-1)
YMDDAY = "0" & mid(YMD,1,YMD1-1)
'Salamander.MsgBox YMD & "#" & YMD1 & "#" & YMD2 & "#" & YMDDAY & "#" & YMDMON
NewFilename = Salamander.SourcePanel.Path & "\" & _
OldName & "_" & mid(YMD,YMD2+1,4) & "-" & Right(YMDMON,2) & "-" & Right(YMDDAY,2)
If OldExtension <> "" Then NewFilename = NewFilename & "." & OldExtension
If ShowProgress Then
Salamander.ProgressDialog.Step(1)
Salamander.ProgressDialog.AddText vbCrLf & OldFilename & " --> " & NewFilename
End If
Overwrite = True
If Fso.FileExists(NewFilename) Then
'neither "skip all" nor "all" has been pressed before, ask
If OverwriteAnswer < 17 then _
OverwriteAnswer = Salamander.OverwriteDialog(NewFilename, OldFilename, 4)
Select Case OverwriteAnswer
Case 2
Salamander.AbortScript() ' Cancel
Case 7, 16, 17
Overwrite = False
Case Else ' Overwrite, target has to be deleted
If IsDirectory then
Fso.DeleteFolder NewFilename
Else
Fso.DeleteFile NewFilename
End If
End Select
End If
If Overwrite then
If DOCOPY then
If IsDirectory Then
Fso.CopyFolder OldFilename, NewFilename
Else
Fso.CopyFile OldFilename, NewFilename
End If
Else
If IsDirectory Then
Fso.MoveFolder OldFilename, NewFilename
Else
Fso.MoveFile OldFilename, NewFilename
End If
End If
End If
End If
End Sub
Sub SplitFilenameAndExtension(FileName, Name, Extension)
Dim n
For n = Len(FileName) to 1 step -1
If Mid(FileName, n, 1) = "." Then Exit For
Next
if n < 1 then
Name = FileName
Extension = ""
Else
Name = Left(FileName, n - 1)
Extension = Mid(FileName, n + 1)
End If
End Sub
- Attachments
-
- renameorcopy2filedate.txt
- (4.57 KiB) Downloaded 788 times
Kind regards, KNUT
_____________________________________________
Satisfied Servant Salamander User from Version 1.5 till now
_____________________________________________
Satisfied Servant Salamander User from Version 1.5 till now
Re: Automation Script Contest: 3 Free Salamander Licenses
Ahoj soutěžci (hezký tvar, ne? ), velké díky tvůrcům AS (aneb něco chci a tak začínám podkuřovat ):
Už dlouho jsem se chystal zprovoznit "Image Resize script" dle vlákna Convert Images automation plugin, zkusil jsem ho pustit ale hned cosi zařval (dohledáno třeba zde: PB44: Automation plugin a externi program), tak jsem si tedy stáhl a nainstaloval utilitku [url=http://image_magick.veidrodis.com/image_magick/windows/ImageMagick-windows.zip]ImageMagic[/url] (nechápu proč nemají na stránkách přímé odkazy na instalátor a člověk se musí brodit celým jejich mirrorem).
Ještě před ruční editací skriptu C:\Program Files\Altap Salamander 2.53\plugins\automation\scripts\Convert Images.js jsem si ho zkusil pustit jen tak - a byl velice příjemně překvapen, že se umí sám zeptat na cestu k prográmku).
Ovšem tím příjemná překvapení skončila:
Je zde zřejmě sice možnost nějakého rekurznivního vnoření se do adresářové struktury, ale GUI nenabízí prakticky žádné možnosti + upravená fotka přišla o Exif info (zjištěno jen náhodou (Landscape místo Portrét zobrazení náhledu)) - i přestože dle BUG: convert 6.5 -resize looses EXIF tag XResolution by to už přes rok mělo být vyřešeno (stáhnul jsem nejnovější versi z 2011-02-13, tj. 6.6.7-7).
Navíc pokud pustím na totožný obrázek Irfan View, ušetřím (při nastavení 50% kvality - tento posuvník (či číselná hodnota) by byl pro skript mým ideálem) 88% místa. I samotný PictView to zvládá (automaticky a bez zřejmé možnosti nastavení) na 75% původní velikosti (tj. ale dvojnásobná oproti Irfanu), zatímco tento skript vygeneruje jen soubor poloviční velikosti oproti původnímu... :-/\
Když jsem ho snižováním "-quality" parametru (až na pouhých 25) donutil dojít na stejnou velikost souboru, vykazoval daleko větší "zubatost" + se navíc snížilo i celkové rozlišení...
Velice příjemná by byla i možnost zachování původního data ve vlastnostech obrázků.
Našla by se tedy (prosím prosím) dobrá duše, která by mi poradila jak změnit onen řádek: dle mých představ?
Edit:
Ether tu několíkráte zmiňoval (nesrovnatelně menší) utilitku NConvert - uměl by ji případně někdo někdo "zasekat" do "ImageResizeScriptu"?
Už dlouho jsem se chystal zprovoznit "Image Resize script" dle vlákna Convert Images automation plugin, zkusil jsem ho pustit ale hned cosi zařval (dohledáno třeba zde: PB44: Automation plugin a externi program), tak jsem si tedy stáhl a nainstaloval utilitku [url=http://image_magick.veidrodis.com/image_magick/windows/ImageMagick-windows.zip]ImageMagic[/url] (nechápu proč nemají na stránkách přímé odkazy na instalátor a člověk se musí brodit celým jejich mirrorem).
Ještě před ruční editací skriptu C:\Program Files\Altap Salamander 2.53\plugins\automation\scripts\Convert Images.js jsem si ho zkusil pustit jen tak - a byl velice příjemně překvapen, že se umí sám zeptat na cestu k prográmku).
Ovšem tím příjemná překvapení skončila:
Je zde zřejmě sice možnost nějakého rekurznivního vnoření se do adresářové struktury, ale GUI nenabízí prakticky žádné možnosti + upravená fotka přišla o Exif info (zjištěno jen náhodou (Landscape místo Portrét zobrazení náhledu)) - i přestože dle BUG: convert 6.5 -resize looses EXIF tag XResolution by to už přes rok mělo být vyřešeno (stáhnul jsem nejnovější versi z 2011-02-13, tj. 6.6.7-7).
Navíc pokud pustím na totožný obrázek Irfan View, ušetřím (při nastavení 50% kvality - tento posuvník (či číselná hodnota) by byl pro skript mým ideálem) 88% místa. I samotný PictView to zvládá (automaticky a bez zřejmé možnosti nastavení) na 75% původní velikosti (tj. ale dvojnásobná oproti Irfanu), zatímco tento skript vygeneruje jen soubor poloviční velikosti oproti původnímu... :-/\
Když jsem ho snižováním "-quality" parametru (až na pouhých 25) donutil dojít na stejnou velikost souboru, vykazoval daleko větší "zubatost" + se navíc snížilo i celkové rozlišení...
Velice příjemná by byla i možnost zachování původního data ve vlastnostech obrázků.
Našla by se tedy (prosím prosím) dobrá duše, která by mi poradila jak změnit onen řádek:
Code: Select all
var imageMagickParams = "-resample 100x100 -quality 80";
Edit:
Ether tu několíkráte zmiňoval (nesrovnatelně menší) utilitku NConvert - uměl by ji případně někdo někdo "zasekat" do "ImageResizeScriptu"?
Re: Automation Script Contest: 3 Free Salamander Licenses
Python Automation Script: "Imgur Upload.pys"
Tested on Python 2.6.6. Should work with later Python version also. Python 2.5 would need "json" module IIRC
Uses Standard Python Library, although http://sourceforge.net/projects/pywin32/ is needed for COM magic to work (or Active Python distribution)
OK. Those were boring facts which shouldn't make a difference in most cases.
Script itself: http://pastebin.com/BhLaVpX4
Download: http://pastebin.com/download.php?i=BhLaVpX4
When evoked it would try to upload current focused file, then provide various links
In action:
Tested on Python 2.6.6. Should work with later Python version also. Python 2.5 would need "json" module IIRC
Uses Standard Python Library, although http://sourceforge.net/projects/pywin32/ is needed for COM magic to work (or Active Python distribution)
OK. Those were boring facts which shouldn't make a difference in most cases.
Script itself: http://pastebin.com/BhLaVpX4
Download: http://pastebin.com/download.php?i=BhLaVpX4
When evoked it would try to upload current focused file, then provide various links
In action:
Re: Automation Script Contest: 3 Free Salamander Licenses
Have a question also
Does Salamander COM object exist to be called with Dispatch i.e.?
I tried "win32com.client.Dispatch('Salamander.Application')", but nothing
I browser available ProgIDs but couldn't find anything related to Altap or Salamander or Automation
Does Salamander COM object exist to be called with Dispatch i.e.?
I tried "win32com.client.Dispatch('Salamander.Application')", but nothing
I browser available ProgIDs but couldn't find anything related to Altap or Salamander or Automation
-
- Plugin Developer
- Posts: 216
- Joined: 09 Dec 2005, 23:23
- Location: Ceske Budejovice, Czech Republic
- Contact:
Re: Automation Script Contest: 3 Free Salamander Licenses
The Salamander object is not available outside the Automation script, it's only accessible through the Salamander global variable. You cannot instantiate it using Dispatch or any other mechanism the language provides. What are you trying to do?otrov wrote:Does Salamander COM object exist to be called with Dispatch i.e.?
I tried "win32com.client.Dispatch('Salamander.Application')", but nothing
I browser available ProgIDs but couldn't find anything related to Altap or Salamander or Automation