Delete Hidden Items Script
Hi all,
I'm not so great with scripts, so can anyone help me out with a simple script to delete all non visible items?
Thanks in advance for any help.
Thanks. I've downloaded Scriptographer and will give it a go. Monika's answer was helpful however I managed to knock up this script which does pretty much exactly what I want. I only want the hidden objects to be deleted on a "Cut" layer.
if ( app.documents.length > 0 )
aDoc = app.activeDocument;
var aLayer = aDoc.activeLayer;
//alert("Active Layer: " + aLayer);
// Delete Hidden Objects
sourceLayer = aDoc.layers.getByName("Cut");
var aPageItems = sourceLayer.pageItems;
if (aPageItems.length > 0)
for(i = 0; i < aPageItems.length; i++)
// alert( "Element: " + sourceLayer.pageItems[i]);
if (aPageItems[i].typename == "GroupItem")
// alert( "GROUPITEM");
var aPathItems = aPageItems[i].pathItems;
for(i2 = 0; i2 < aPathItems.length; i2++)
// alert( "Element: " + aPathItems[i2].hidden);
if (aPathItems[i2].hidden == true)
// alert( "Deleting: " + aPathItems[i2]);
aPathItems[i2].remove();
i2=i2-1;
i=i-1;
Thanks everyone for their help.
Similar Messages
-
How to Make a "show hidden items" script in Automator
I would like to make an Automator application that i can launch to show hiddden files, then another one to launch to hide them again. I tried using the shell script option, with this in it:
defaults write com.apple.Finder AppleShowAllFiles TRUE
then I typed this in the next box:
killall Dock
It only killalled the dock, no hidden items shown.Simpler to just create an AppleScript application, put it onto the Dock, and then just click on it. It's a toggle: unhides on one click and hides on another. This is what I use:
try
do shell script "defaults read com.apple.finder AppleShowAllFiles"
on error
do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
end try
if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is equal to "0" then
do shell script "defaults write com.apple.finder AppleShowAllFiles 1"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
end if
do shell script "killall Finder" -
I wish, I wish for a javascript that would check my open document for hidden layers and delete them, thats all.
Thank you,
RichardHello try67 and thank you very much for the script.
It works well but not at 100%.
As an example:
If I have a InDesign file with 20 hidden layers. The script will delete 10, then when double-clicked again 5 more will be gone, do it again and 2 more will be deleted, so the run command needs to be repeated until all hidden layers are gone.
I cannot find any particular pattern as to the way layers are deleted and what prompt the script to stop, but I am sure there is one.
If you find out why please let me know, in the mean time this sure beats: selecting layers, right click, select delete layers, click yes, wait...
Thanks again,
Richard -
HT201322 how can you delete hidden items for good?
I want to decrease clutter and get rid of apps from hidden area and from purchase area. I want them gone for good.
Sorry, but that is not possible. Hiding the purchase is all you can do.
Regards. -
I am trying to make an action (that is using some scripts) that will delete hidden layers. When I try and action that in photoshop, the actions stops for an error if the file didn't have any hidden layers. I think I need to script it so it will delete the hidden layers, and keep going if there aen't any.
I couldnt find anything in th ejavascript ref guide for doing this. ( I'm sure I was looking right at it, I am a noob).
Thanks for any help you can give.Here is a script to will delete hidden layers but not throw an error is there are no hidden layers.
try{
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), stringIDToTypeID( "hidden" ) );
desc.putReference( charIDToTypeID( "null" ), ref );
executeAction( charIDToTypeID( "Dlt " ), desc, DialogModes.NO );
}catch(e){}
Note you could also do this with just actions steps. Have the action add a layer then hide it before the delete hidden layers menu item step. That way there would always be at least one hidden layer and no error. -
Get item value of hidden item in java script on standard report
I've a report with following query:
select "ROWID",
"GTEMPDETAILID",
"GTEMPID",
"NORMTEXT",
"ITEMTYP",
"ITEM",
"BEMERKUNG"
from "#OWNER#"."ALAVIS_GTEMPDETAILS"
Item GTEMPDETAILID is hidden (set in column attributes).
I defined an onclick event in the report template to set the value of GTEMPDETAILID into a Page item. This works, if the GTEMPDETAILID is not hidden. But how can I get the value of an hidden item in javascript?I am guessing this hidden value is not a protected item because youre manipulating the value. How about setting is a textfield but inside the "HTML form element" property, specify style="display:none;" or you can nest <script type="text/javascript">$x_Hide("ID_OF_TEXTFIELD");</script> in the page somewhere...
Question, have you tried using $x_Value('ID_OF_ITEM','VALUE_OF_ITEM') ? this is APEX javascript API
you can also use $x('ID_OF_ITEM') to retrieve DOM object, or $v('ID_OF_ITEM); to retrieve item values.
Let me know if you need additional assistance.
Edited by: srbonham1 on Jul 27, 2012 4:31 PM -
Using script to delete list item attachment
$.ajax({
url: "/_api/lists/getByTitle('Test')/getItemById(1)/AttachmentFiles/getByFileName('test.txt')",
method: 'DELETE',
headers: {
'X-RequestDigest': $('#__REQUESTDIGEST').val()
i want to delete list item attachment using script.
Above code working only in ie
in firefox and chrome it fails
Any sugestion cladsworking fine when i degug the script...
-
How can I delete an item from the main left column of iTunes?
I'd like to delete an item from the main left hand column in iTunes (the column containing the main headings LIBRARY, STORE, SHARED, PLAYLISTS etc etc). Under the first heading 'LIBRARY' appear the items Library, Music, Movies, iTunes U, Books, Apps and Ringtones. I'd like to remove the item "Library" from that list - it appears immediately after the heading "LIBRARY" and serves no purpose whatsoever. (Neither does it appear to cause any harm, I must say, just a nuisance.) This item does not appear in any of the iTunes viewing options or controls lists. Neither does it appear in iTunes in the other accounts on my Mac and I have yet to see it any other iTunes on any other Mac.
I've upgraded since about iTunes 8 assuming the problem would eventually disappear through the upgrades but it hasn’t, even through all the providedupgrade increments available for iTunes.
I'm assuming it's from something I've installed in my main user account at some stage and it entered this item in the iTunes app. But I can't see how to remove it. The only things I can remember installing are "iTunes Batch Column Renamer" and "Join Together", both if which are just Scripts and which I use fairly regularly, but I don't recall either of them installing that particular item.
Is there any folder I can navigate to to edit the list of items in that main left hand column of iTunes?
Many thanks in advance for any help offered.on second thought, that you have an item "library" is indeed odd - there shouldn't be.
suggest you try removing iTunes completely (click here and follow the instructions), then reinstall it using the standalone installer from here: http://www.apple.com/itunes/download/.
note this will not do anything to your media files, playlists, ratings, etc.
btw, you didn't install any 3rd party tools like this script:
Change Hidden iTunes Preferences v2.4
This application will allow you to invoke hidden iTunes preferences:
Show "Library" playlist
Changing view setting is global
Allow half-stars in ratings
Hide "Ping" buttons
Show/hide arrow links -- to either search the iTunes Store or search your library
Load complete iTunes Store preview before playing
Create playlists for purchased song collections
Play songs while importing or converting
Create file names with track number
Maintain grid view for Search results
Option-click zoom button for Mini Player&
Show buttons horizontally
Message was edited by: Jolly Giant -
How do I delete multiple items at once instead of one at a time?
How do I delete multiple items at once instead of one at a time? I have several duplicate items in my library and would like to delete the duplicates. Thanks!
You can select multiple items using shift to select a range and control to add or remove items from it.
Regarding duplciates, Apple's official advice is here... HT2905 - How to find and remove duplicate items in your iTunes library. It is a manual process and the article fails to explain some of the potential pitfalls.
Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group of identical tracks to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created. If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin. This can happen, for example, if you start iTunes with a disconnected external drive, then connect it, reimport from your media folder, then restart iTunes.
Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background. Please take note of the warning to backup your library before deduping, whether you do so by hand or using my script, in case something goes wrong.
(If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
tt2 -
Javascript: set value of hidden item
Hi,
I have a select list and a hidden item on my page, after select a value, I want to write this value (and a little bit more) to the hidden item.
So I have done the following...
applied to page html header:
<script language="JavaScript" type="text/javascript">
function setExpress(item_id)
html_GetElement('P230_HIDDEN').value = 'Test ' + html_GetElement(item_id).value;
</script>
and in selection list I set the HTML Form Element Attributes to onChange="setExpress(this.id); .
But nothing is written to the hidden item. When I make it a text field it works correct.
Isn't it possible to set a value of hidden item by javascript? Is there another way to do this (without computation)?
Thanks for help
chrissyHello chrissy,
I don't see the connection between the item being Hidden or Text. The item id stays the same, and so the JavaScript reference to it.
It is possible to assign values to hidden items using JavaScript, just as you did. In the following page - http://htmldb.oracle.com/pls/otn/f?p=22814:8
-you can see a working example of your situation select list populate a hidden item, then display by using alert.
After selecting from the list you should TAB out, so it will fire the JavaScript event. In your example, you were using onChange. I think that could be problematic in cases were the default value (first value) of the select list is the one chosen no change there. In my example, I'm using onBlur.
You can see the JavaScript on the source page.
Hope this help,
Arie. -
Hi,
I am having a hidden page item P4_SELECT in my page. I am trying to set this page item with a value in javascript function.
function getTheCurrentRow(triggerItem){
alert( triggerItem.slice(6));
document.getelementbyid(P4_SELECT).value=triggerItem.slice(6);
// $x(P4_SELECT).value=triggerItem.slice(6);
</script>Eventhough i am getting value in the alert getting javascript error "P4_SELECT Undefined" .
When i checked the "view Source" of the page it is having this line in it
<input type="hidden" name="p_t04" value="" id="P4_SELECT" />I tried
$x(P4_SELECT).value=triggerItem.slice(6);But getting same result only. Can't we set hidden item values in Javascript.
Regards,
JyothiHi,
If you are on Apex 3.x or higher , try
function getTheCurrentRow(triggerItem){
alert( triggerItem.slice(6));
$s("P4_SELECT", triggerItem.slice(6));
/* Alert hidden item value you did set */
alert($v("P4_SELECT"));
</script>Here is link to Apex JavaScript API document where you can find functions $s and $v I did use
http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/javascript_api.htm#CDEEIGFH
Regards,
Jari -
How to delete an item in adept database
I would like to know how to delete an item in my adept Inventory or/and in my Distributor with a script putting the ID as a variable.
What woud you advise ?
ThanksHai Madhu,
It is pretty simple.
First u define a button. and in onAction Event of the button write the following code.
process is as follows:
1)get the node
2)get the element
3)using the method remove_element() ,remove the element.
<u><b>The Sample Code is as follows</b></u>
DATA:
node_flighttab TYPE REF TO if_wd_context_node,
elem_flighttab TYPE REF TO if_wd_context_element.
node_flighttab = wd_context->get_child_node( 'FLIGHTTAB' ).
get element via lead selection
elem_flighttab = node_flighttab->get_element( ).
node_flighttab->remove_element( element = elem_flighttab ).
Follow the above code ,it will definately help you. -
Displaying not hidden items in the page
Hi,
Could you please let me know how I can identify hidden items programmatically? i.e. We have some items in a page and suppose some of the items are hidden. I need to provide a list of not hidden items. How can I recognize hidden items and not to display them in my list?
Regards,
SetarehThanks for your reply. But I need to identify hidden items not inactive or deleted items. So far I know active field in wwsbr_all_items doesn't get value for hidden items just for deleted, inactive, and active items.
Regards,
Setareh -
hi All,
I have a requirement for updating the contact list from CSV file and updating/ adding and deleting the changes in the SharePoint list using PowerShell script. List is also synced with outlook.
The problem arises, when we delete an item from the list using PS, the item (which was earlier synced with outlook) is not getting deleted from outlook.
Strange behavior : when we perform the same deletion operation manually from the SharePoint UI, every thing works fine as required.
Please refer the below PS
#Adding the records from SharePoint not in CSV file
if($flag -ne 1)
Get-Member -InputObject $csvRow -MemberType NoteProperty | ForEach-Object {
$property = $_.Name
$newItem.set_Item($property, $csvRow.$property)
$newItem.Update()
#Deleting the records from SharePoint not in CSV file
CreatePSLog "Deleting the records from SharePoint not in CSV file"
foreach($itm in $List.items)
$del = 0
$items | ForEach-Object {
if($itm["SAP Ansprechpartnernr"] -eq $_."SAP Ansprechpartnernr")
$del++;
if(!$del)
$List.GetItemById($itm.Id).Delete()
$List.Update();
$Web.Update();
many thanks in advance, Please suggest as I am completly stuck on this :(
Regards, Arun kumarHi Kumar,
Please remove the codeline $List.Update();, then run your code again, it works for me.
You may need to firstly delete the synced contacts list within Outlook to remove those undeleted accounts, then re-connect the SharePoint contacts list to outlook, then run your modified Powershell code.
Thanks
Daniel Yang
TechNet Community Support -
I have the iPhone 4, and yesterday I synced my photos onto iTunes, but now I have albums on my phone that cannot be deleted, and there is not an option to delete the items in the albums individually... How do I get rid of these unwanted albums? Using Windows 7.
If you used iTunes to get the photos on the phone, then use the same iTunes and uncheck the music you don't want and do another sync.
Maybe you are looking for
-
How do booth my computer from my backup disk?
I am using Silverkeeper on a LaCie firewire external drive, and have backed up regularly every week for the past few years. As I am getting ready to install Leopard I would like to find out how to use my backup to restart my computer in case the inst
-
7.4 HA-SKU with N+1 Design
Hello all, I was just reviewing the config guide for 7.3 and HA-SSO and then I found out that with 7.4 it allows for an N+1 scenario. http://www.cisco.com/en/US/prod/collateral/wireless/ps6302/ps8322/ps10315/qa_c67-714540_ps2706_Products_Q_and_A_Item
-
Delivery Date for PR in Sales Order
Dear All, We have a case where Sales order will trigger a Purchase requisition when the Material is non-stock. But when looking at the Delivery date for the Purchase Requisition in the Sales order, the delivery date is always the creation date, which
-
Just downloaded the 7.1.1 IOS update and I'm able to stream my music from the cloud. I'm wondering how I can stream more than just my purchased music?And does this use up data? Also, how can I get playback to stop pausing for periods of time? It is a
-
I have a Mac Prod (mid 2006) and OS X 10.7.5 installed. I had a Win7 bootcamp install that I upgraded to Win 8. Windows did boot up the first time around, but since then I have been getting INACCESSIBLE_BOOT_DEVICE when windows tries to star. I can r