English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 28 October 2018, 09:52   #1
logical
Registered User
 
Join Date: Feb 2018
Location: Germany
Posts: 5
Icon position clearence by Script/ARexx ?

Hi,


How can I clear the Icon position (e.g. of a drawer icon) by script oder by ARexx (so the same I do by workbench with the "Icons->UnSnapshot" command)?
Preferrable by already installed tools/libs in ClassicWB.



Why?
If I e.g. copy a lot of drawer icons with the same position/different names) this will look ugly (=overlapped) by default.
Without the position workbench will do an auto-arrangement.

Last edited by logical; 28 October 2018 at 10:09.
logical is offline  
Old 28 October 2018, 13:51   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,310
RexxMustHave (RMH) library has a seticonattr() function which may work. If you use OS3.9 or OS 3.1.4 you can use the Workbench ARexx port (see ARexx.doc).

Isn't displaying icons faster if they are fixed? In that case it would be better to sort them and then snapshot all.
daxb is offline  
Old 28 October 2018, 17:24   #3
Ami
Registered User
 
Ami's Avatar
 
Join Date: Sep 2014
Location: Poland
Posts: 175
I have written such ARexx script for my personal use long time ago, and here it is:

Code:
/* UnSnapshotAllIcons.rexx 1.0 */

PARSE ARG file

IF file="" | file="?" THEN DO
	SAY 'Usage: UnSnap <file>'
	EXIT 0
END

file=STRIP(file,B,'"')

IF OPEN('i',file,R) THEN DO
	CALL SEEK('i',58,B) /* $3A */
	CALL WRITECH('i',B2C(10000000000000000000000000000000)) /* -1 */
	CALL WRITECH('i',B2C(10000000000000000000000000000000))
	CALL CLOSE('i')
END
ELSE DO
	SAY "Error! Can't open:" file
	EXIT 20
END
Save this as an text file and remember to add S flag!
Ami is offline  
Old 29 October 2018, 20:08   #4
Jope
-
 
Jope's Avatar
 
Join Date: Jul 2003
Location: Helsinki / Finland
Age: 43
Posts: 9,925
The amigaos install disks have an unstick tool as well from 2.1 onwards, called IconPos.

You can scriptify it:
Code:
list #?.info FILES LFORMAT "IconPos >NIL: *"%p%n*" -1 -1\" >ram:unstick
execute ram:unstick
Of course you can replace -1 -1 with positive coordinates if you want to use the tool to snapshot icons instead. :-)
Jope is offline  
Old 30 October 2018, 17:41   #5
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
If you're using Workbench 3.9, 4.x or 3.1.4, Workbench itself has an ARexx port that gives you full control of pretty much all the Workbench functions. Using this, you could simply get the current window, invoke the Select All menu function, invoke the Unsnapshot menu item, and you're done.
Daedalus is offline  
Old 30 October 2018, 20:19   #6
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,385
Quote:
Originally Posted by Jope View Post
The amigaos install disks have an unstick tool as well from 2.1 onwards, called IconPos. You can scriptify it:
Code:
list #?.info FILES LFORMAT "IconPos >NIL: *"%p%n*" -1 -1\" >ram:unstick
execute ram:unstick
Of course you can replace -1 -1 with positive coordinates if you want to use the tool to snapshot icons instead. :-)
Oh, didn't know that command yet. I hope it won't destroy OS 3.5 icons.

But -1, -1 does not mean unstick, it's just one pixel left and up relative to the window. "NO_ICON_POSITION" is $80000000, as you can see in Ami's code, too. But his comment /* -1 */ is wrong, it's -2GB.

I think IconPos has special arguments like FreeX, FreeY, but I didn't try IconPos yet.
PeterK is offline  
Old 01 November 2018, 16:38   #7
logical
Registered User
 
Join Date: Feb 2018
Location: Germany
Posts: 5
Thanks for your answers.
IconPos seems to be what I was searching for, I didn't find it as it wasn't installed by default with MagicWB - I now made the un-snapshot optional.

Here now what the ARexx procedure for checking/creating a new directory looks like (is part of the walk-over-all-folders code):

Code:
CHECK_DIR: procedure
parse arg dir
/* create folder if it doesn't exist and make sure drawer icon is present */
if ~exists(dir) then address command 'makedir "'dir'"'
if ~exists(dir'.info') then do
  address command 'copy "ENV:Sys/def_drawer.info" "'dir'.info"'
  /* un-snapshot drawer icon */
  if exists('c:iconpos') then address command 'iconpos "'dir'.info" FREEX FREEY'
end
return 1

Last edited by logical; 02 November 2018 at 01:15.
logical is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem executing DOpus5 Arexx Script ... beltrixx support.Apps 1 01 August 2015 22:16
Simple NewShell script?.. in Arexx? Yoji Coders. General 5 19 May 2015 14:49
CD-ROM icon position fc.studio support.Apps 4 21 December 2005 22:54
wtf? The ram disk icon does not save its position... keropi support.Apps 3 29 November 2005 18:10
Arexx script (txt => hex) Uukrul Coders. General 10 09 September 2001 04:02

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:23.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07736 seconds with 13 queries